From d917cfd916a39f78f91d5960a017a02e5d83ba63 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 29 Mar 2011 10:57:50 +1300 Subject: Refactoring. --- libmproxy/console.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libmproxy/console.py') diff --git a/libmproxy/console.py b/libmproxy/console.py index ed6c78af..399640c2 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -1023,6 +1023,10 @@ class ConsoleMaster(flow.FlowMaster): self.onekey = False self.view_connlist() + self.masterq = Queue.Queue() + slave = controller.Slave(self.masterq, self.server) + slave.start() + self.ui.run_wrapper(self.loop) # If True, quit just pops out to connection list view. print >> sys.stderr, "Shutting down..." @@ -1294,16 +1298,12 @@ class ConsoleMaster(flow.FlowMaster): return size def loop(self): - q = Queue.Queue() - self.masterq = q - slave = controller.Slave(q, self.server) - slave.start() try: while not controller.exit: startloop = time.time() self.statusbar.redraw() size = self.drawscreen() - self.tick(q) + self.tick(self.masterq) self.ui.set_input_timeouts(max_wait=0.1) keys = self.ui.get_input() for k in keys: -- cgit v1.2.3