aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/pathoc.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-10-31 11:23:53 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-10-31 11:34:58 +1300
commit3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4 (patch)
tree9c3bf8fe82326072d2c470f47d12ed654b991fb6 /libpathod/pathoc.py
parent8c6cc8140c6ac51966bdfabd5bb1180c2dd623b0 (diff)
downloadmitmproxy-3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4.tar.gz
mitmproxy-3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4.tar.bz2
mitmproxy-3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4.zip
Use .freeze to implement the -e explain flags for pathod and pathoc.
This now prints (in pathoc) or logs (in pathod) a frozen specification that includes an expanded record of all generated values and locations.
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r--libpathod/pathoc.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index b4020a3f..dcee353f 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -62,6 +62,9 @@ class Pathoc(tcp.TCPClient):
print >> fp, "File access error: %s"%v
return
+ if explain:
+ r = r.freeze(self.settings, self.host)
+
resp, req = None, None
if showreq:
self.wfile.start_log()
@@ -83,6 +86,9 @@ class Pathoc(tcp.TCPClient):
if req:
if ignorecodes and resp and resp[1] in ignorecodes:
return
+ if explain:
+ print >> fp, ">> Spec:", r.spec()
+
if showreq:
self._show(fp, ">> Request", self.wfile.get_log(), hexdump)