diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-03-29 10:57:50 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-03-29 10:57:50 +1300 |
commit | d917cfd916a39f78f91d5960a017a02e5d83ba63 (patch) | |
tree | eea9c1b40628c9d2a253937a953cccdbdd7cd434 /libmproxy/console.py | |
parent | c3105153a5044c49435094505ae13990f48a483f (diff) | |
download | mitmproxy-d917cfd916a39f78f91d5960a017a02e5d83ba63.tar.gz mitmproxy-d917cfd916a39f78f91d5960a017a02e5d83ba63.tar.bz2 mitmproxy-d917cfd916a39f78f91d5960a017a02e5d83ba63.zip |
Refactoring.
Diffstat (limited to 'libmproxy/console.py')
-rw-r--r-- | libmproxy/console.py | 10 |
1 files changed, 5 insertions, 5 deletions
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: |