tfix return, debug flags - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 0a1f6b5c43fbaf6a8f672b18eba11b3aa8e8b24f DIR parent 919ec8e837eef30364212eb7f95e26fc8cc7f850 HTML Author: ThomasV <thomasv@gitorious> Date: Tue, 11 Mar 2014 07:12:57 +0100 fix return, debug flags Diffstat: M lib/daemon.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- DIR diff --git a/lib/daemon.py b/lib/daemon.py t@@ -43,7 +43,7 @@ class NetworkProxy(threading.Thread): self.message_id = 0 self.unanswered_requests = {} self.subscriptions = {} - self.debug = True + self.debug = False self.lock = threading.Lock() t@@ -79,7 +79,7 @@ class NetworkProxy(threading.Thread): def process(self, response): # runs callbacks - #print "<--", response + if self.debug: print "<--", response msg_id = response.get('id') with self.lock: t@@ -110,7 +110,7 @@ class NetworkProxy(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) - # print "-->", request + if self.debug: print "-->", request self.message_id += 1 out += request + '\n' while out: t@@ -179,6 +179,7 @@ class ClientThread(threading.Thread): self.network = network self.queue = Queue.Queue() self.unanswered_requests = {} + self.debug = False def run(self): t@@ -212,7 +213,7 @@ class ClientThread(threading.Thread): def process(self, request): - #print "<--", request + if self.debug: print "<--", request method = request['method'] params = request['params'] _id = request['id'] t@@ -228,6 +229,7 @@ class ClientThread(threading.Thread): except BaseException as e: out['error'] =str(e) self.queue.put(out) + return if method == 'daemon.shutdown': self.server.running = False t@@ -255,7 +257,7 @@ class ClientThread(threading.Thread): while out: n = self.s.send(out) out = out[n:] - #print "-->", r + if self.debug: print "-->", r