diff options
author | FreeArtMan <=> | 2015-08-19 09:05:33 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2015-08-19 09:59:13 +0100 |
commit | 4d9bf45e822396a1d43a2e7712046681f5d433ac (patch) | |
tree | c5c55a3cb592f0595109b1bcf15070303207c587 /examples/read_dumpfile | |
parent | cd419300a952c3eb5a7e2637b536b184b2e9594b (diff) | |
download | mitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.tar.gz mitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.tar.bz2 mitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.zip |
Fixing issue #710. Prety printing in read_dumpfile
Diffstat (limited to 'examples/read_dumpfile')
-rwxr-xr-x | examples/read_dumpfile | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/read_dumpfile b/examples/read_dumpfile index ecddc65d..eb1c93bb 100755 --- a/examples/read_dumpfile +++ b/examples/read_dumpfile @@ -5,15 +5,17 @@ from libmproxy import flow import json +import pprint import sys with open(sys.argv[1], "rb") as logfile: freader = flow.FlowReader(logfile) + pp = pprint.PrettyPrinter(indent=4) try: for f in freader.stream(): print(f) print(f.request.host) - json.dump(f.get_state(), sys.stdout, indent=4) + pp.pprint(f.get_state()) print("") except flow.FlowReadError as v: print "Flow file corrupted. Stopped loading." |