aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFreeArtMan <=>2015-08-19 09:05:33 +0100
committerFreeArtMan <dos21h@gmail.com>2015-08-19 09:59:13 +0100
commit4d9bf45e822396a1d43a2e7712046681f5d433ac (patch)
treec5c55a3cb592f0595109b1bcf15070303207c587
parentcd419300a952c3eb5a7e2637b536b184b2e9594b (diff)
downloadmitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.tar.gz
mitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.tar.bz2
mitmproxy-4d9bf45e822396a1d43a2e7712046681f5d433ac.zip
Fixing issue #710. Prety printing in read_dumpfile
-rwxr-xr-xexamples/read_dumpfile4
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."