aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/help.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/console/help.py')
-rw-r--r--libmproxy/console/help.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/libmproxy/console/help.py b/libmproxy/console/help.py
index 27288a36..73cd8a50 100644
--- a/libmproxy/console/help.py
+++ b/libmproxy/console/help.py
@@ -1,6 +1,8 @@
from __future__ import absolute_import
+
import urwid
-from . import common
+
+from . import common, signals
from .. import filt, version
footer = [
@@ -8,9 +10,9 @@ footer = [
('heading_key', "q"), ":back ",
]
+
class HelpView(urwid.ListBox):
- def __init__(self, master, help_context, state):
- self.master, self.state = master, state
+ def __init__(self, help_context):
self.help_context = help_context or []
urwid.ListBox.__init__(
self,
@@ -122,7 +124,9 @@ class HelpView(urwid.ListBox):
("T", "set tcp proxying pattern"),
("u", "set sticky auth expression"),
]
- text.extend(common.format_keyvals(keys, key="key", val="text", indent=4))
+ text.extend(
+ common.format_keyvals(keys, key="key", val="text", indent=4)
+ )
text.append(urwid.Text([("head", "\n\nFilter expressions:\n")]))
f = []
@@ -167,16 +171,15 @@ class HelpView(urwid.ListBox):
("~q ~b test", "Requests where body contains \"test\""),
("!(~q & ~t \"text/html\")", "Anything but requests with a text/html content type."),
]
- text.extend(common.format_keyvals(examples, key="key", val="text", indent=4))
+ text.extend(
+ common.format_keyvals(examples, key="key", val="text", indent=4)
+ )
return text
def keypress(self, size, key):
key = common.shortcuts(key)
if key == "q":
- self.master.statusbar = self.state[0]
- self.master.body = self.state[1]
- self.master.header = self.state[2]
- self.master.make_view()
+ signals.pop_view_state.send(self)
return None
elif key == "?":
key = None