equal
deleted
inserted
replaced
21 if sys.argv[1] == '-': |
21 if sys.argv[1] == '-': |
22 log = sys.stderr |
22 log = sys.stderr |
23 else: |
23 else: |
24 log = open(sys.argv[1], 'a') |
24 log = open(sys.argv[1], 'a') |
25 |
25 |
|
26 |
26 def read(size): |
27 def read(size): |
27 data = sys.stdin.read(size) |
28 data = sys.stdin.read(size) |
28 if not data: |
29 if not data: |
29 raise EOFError |
30 raise EOFError |
30 sys.stdout.write(data) |
31 sys.stdout.write(data) |
31 sys.stdout.flush() |
32 sys.stdout.flush() |
32 return data |
33 return data |
|
34 |
33 |
35 |
34 try: |
36 try: |
35 while True: |
37 while True: |
36 header = read(outputfmtsize) |
38 header = read(outputfmtsize) |
37 channel, length = struct.unpack(outputfmt, header) |
39 channel, length = struct.unpack(outputfmt, header) |