From 3f50930dc06a980ac5dcf012fa23ecc0a70ce1b4 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 31 Oct 2012 11:23:53 +1300 Subject: 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. --- libpathod/pathoc.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libpathod/pathoc.py') 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) -- cgit v1.2.3