mirror of https://github.com/dirtbags/netarch.git
a better execution harness
This commit is contained in:
parent
104b85a736
commit
a7fa1c0d24
|
@ -88,10 +88,14 @@ class StinkyPinkySession(ip.HtmlSession):
|
||||||
# execution harness
|
# execution harness
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
s = None
|
sessions = {}
|
||||||
reseq = ip.Dispatch(*sys.argv[1:])
|
dp = ip.Dispatch(*sys.argv[1:])
|
||||||
for h, d in reseq:
|
for fhash, chunk in dp:
|
||||||
srv, first, chunk = d
|
is_srv, frame, gs = chunk
|
||||||
if not s:
|
if not frame:
|
||||||
s = StinkyPinkySession(first)
|
continue
|
||||||
s.handle(srv, first, chunk, reseq.last)
|
if fhash not in sessions:
|
||||||
|
sessions[fhash] = StinkyPinkySession(frame)
|
||||||
|
sessions[fhash].handle(is_srv, frame, gs, dp.last)
|
||||||
|
for sess in sessions.itervalues():
|
||||||
|
sess.done()
|
||||||
|
|
Loading…
Reference in New Issue