diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-10-31 11:23:53 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-10-31 11:34:58 +1300 |
commit | 3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4 (patch) | |
tree | 9c3bf8fe82326072d2c470f47d12ed654b991fb6 /libpathod/pathoc.py | |
parent | 8c6cc8140c6ac51966bdfabd5bb1180c2dd623b0 (diff) | |
download | mitmproxy-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.py | 6 |
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) |