Skip to content
Snippets Groups Projects
Commit ba818d3c authored by Bruce Flynn's avatar Bruce Flynn
Browse files

fix issue with edosl0info that required -v to see any output

parent 287f4a7b
No related branches found
No related tags found
No related merge requests found
import io
import logging
from edosl0util.cli import util
from edosl0util import stream
LOG = logging
from edosl0util import stream
from edosl0util.cli import util
def main():
......@@ -23,19 +21,18 @@ def main():
packets.next()
num_packets += 1
except stream.PacketTooShort as err:
LOG.warn("corrupt packet stream after %d packets: %s",
num_packets, err)
print("corrupt packet stream after %d packets: %s" % (num_packets, err))
break
except StopIteration:
break
total = 0
first, last, info = packets.info()
LOG.info("First: %s", first)
LOG.info("Last: %s", last)
print("First: %s" % first)
print("Last: %s" % last)
for apid, dat in info.items():
total += dat['count']
LOG.info("%d: count=%d missing=%d", apid, dat['count'], dat['num_missing'])
LOG.info("{} total packets".format(total))
print("%d: count=%d missing=%d", apid, dat['count'], dat['num_missing'])
print("{} total packets".format(total))
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment