tinterface.debug flag - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 0b2c09d20b389af4ab1fef4ad6061fe64fafd15f DIR parent 6faf1acc055153bbf01f93bf33e0eb45d927aa18 HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 4 Oct 2013 16:00:20 +0200 interface.debug flag Diffstat: M lib/interface.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/interface.py b/lib/interface.py t@@ -103,6 +103,8 @@ class Interface(threading.Thread): self.is_connected = False self.poll_interval = 1 + self.debug = False # dump network messages. can be changed at runtime using the console + #json self.message_id = 0 self.unanswered_requests = {} t@@ -131,7 +133,8 @@ class Interface(threading.Thread): def queue_json_response(self, c): # uncomment to debug - # print_error( "<--",c ) + if self.debug: + print_error( "<--",c ) msg_id = c.get('id') error = c.get('error') t@@ -433,8 +436,8 @@ class Interface(threading.Thread): request = json.dumps( { 'id':self.message_id, 'method':method, 'params':params } ) self.unanswered_requests[self.message_id] = method, params, callback ids.append(self.message_id) - # uncomment to debug - # print "-->", request + if self.debug: + print "-->", request self.message_id += 1 out += request + '\n' while out: