Skip to content

Commit

Permalink
pcaptool fix for no output on invoking from console_scripts hook
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Mar 4, 2022
1 parent 5808bf3 commit 34858cb
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions okdmr/dmrlib/tools/pcap_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,19 +348,17 @@ def main(
arguments = sys.argv[1:]

args = PcapTool._arguments().parse_args(arguments)
return (
PcapTool.print_pcap(
files=args.files,
ports_whitelist=args.whitelist_ports,
ports_blacklist=args.blacklist_ports,
print_statistics=not args.no_statistics,
callback=EmbeddedExtractor().process_packet
if args.extract_embedded_lc
else PcapTool.debug_packet,
)
if return_stats
else None
stats = PcapTool.print_pcap(
files=args.files,
ports_whitelist=args.whitelist_ports,
ports_blacklist=args.blacklist_ports,
print_statistics=not args.no_statistics,
callback=EmbeddedExtractor().process_packet
if args.extract_embedded_lc
else PcapTool.debug_packet,
)
if return_stats:
return stats


if __name__ == "__main__":
Expand Down

0 comments on commit 34858cb

Please sign in to comment.