diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-09 10:05:13 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-09 10:05:13 +1200 |
commit | d7748cea4f209d45af99e5ac03438faa3184bc64 (patch) | |
tree | bc05e4c3c4be394d62ea33fad4deb62783a40046 /libmproxy/console/__init__.py | |
parent | 8fa96d1f3f961b4db67bc6c2edf2566f3d96a27f (diff) | |
download | mitmproxy-d7748cea4f209d45af99e5ac03438faa3184bc64.tar.gz mitmproxy-d7748cea4f209d45af99e5ac03438faa3184bc64.tar.bz2 mitmproxy-d7748cea4f209d45af99e5ac03438faa3184bc64.zip |
Minor name refactoring, make flow list refresh after limit is applied.
Diffstat (limited to 'libmproxy/console/__init__.py')
-rw-r--r-- | libmproxy/console/__init__.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index ee2ca408..3db188de 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -357,7 +357,7 @@ class ConsoleMaster(flow.FlowMaster): for i in options.replacements: self.replacehooks.add(*i) - self.flow_list_view = None + self.flow_list_walker = None self.set_palette() r = self.set_intercept(options.intercept) @@ -513,7 +513,7 @@ class ConsoleMaster(flow.FlowMaster): self.ui = urwid.raw_display.Screen() self.ui.set_terminal_properties(256) self.ui.register_palette(self.palette) - self.flow_list_view = flowlist.ConnectionListView(self, self.state) + self.flow_list_walker = flowlist.FlowListWalker(self, self.state) self.view = None self.statusbar = None @@ -544,7 +544,7 @@ class ConsoleMaster(flow.FlowMaster): def focus_current(self): if self.currentflow: try: - self.flow_list_view.set_focus(self.state.index(self.currentflow)) + self.flow_list_walker.set_focus(self.state.index(self.currentflow)) except (IndexError, ValueError): pass @@ -584,7 +584,7 @@ class ConsoleMaster(flow.FlowMaster): if self.eventlog: self.body = flowlist.BodyPile(self) else: - self.body = flowlist.ConnectionListBox(self) + self.body = flowlist.FlowListBox(self) self.statusbar = StatusBar(self, flowlist.footer) self.header = None self.currentflow = None @@ -640,7 +640,7 @@ class ConsoleMaster(flow.FlowMaster): except flow.FlowReadError, v: return v.strerror f.close() - if self.flow_list_view: + if self.flow_list_walker: self.sync_list_view() self.focus_current() @@ -697,7 +697,9 @@ class ConsoleMaster(flow.FlowMaster): self.state.accept_all() def set_limit(self, txt): - return self.state.set_limit(txt) + v = self.state.set_limit(txt) + self.sync_list_view() + return v def set_intercept(self, txt): return self.state.set_intercept(txt) @@ -788,7 +790,6 @@ class ConsoleMaster(flow.FlowMaster): self.state.intercept_txt, self.set_intercept ) - self.sync_list_view() elif k == "Q": raise Stop elif k == "q": @@ -816,7 +817,6 @@ class ConsoleMaster(flow.FlowMaster): p, self.set_reverse_proxy ) - self.sync_list_view() elif k == "R": self.view_grideditor( grideditor.ReplaceEditor( @@ -907,7 +907,7 @@ class ConsoleMaster(flow.FlowMaster): controller.Master.shutdown(self) def sync_list_view(self): - self.flow_list_view._modified() + self.flow_list_walker._modified() def clear_flows(self): self.state.clear() |