aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/options.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-03 20:04:19 +1300
committerAldo Cortesi <aldo@nullcube.com>2015-04-03 20:04:19 +1300
commit3704411466364bea76e0fb231cd1724f45318522 (patch)
treeb1e91843a8a3f485924d3b095a7202c04f59175a /libmproxy/console/options.py
parentaadaa66d0b92ce7e97e3303e3152a2dda6d320e9 (diff)
downloadmitmproxy-3704411466364bea76e0fb231cd1724f45318522.tar.gz
mitmproxy-3704411466364bea76e0fb231cd1724f45318522.tar.bz2
mitmproxy-3704411466364bea76e0fb231cd1724f45318522.zip
Minimal help context for options
Diffstat (limited to 'libmproxy/console/options.py')
-rw-r--r--libmproxy/console/options.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/libmproxy/console/options.py b/libmproxy/console/options.py
index db6cc151..e2227f08 100644
--- a/libmproxy/console/options.py
+++ b/libmproxy/console/options.py
@@ -2,12 +2,21 @@ import urwid
from . import common, signals
-help_context = None
footer = [
('heading_key', "enter/space"), ":toggle ",
('heading_key', "C"), ":clear all ",
]
+def _mkhelp():
+ text = []
+ keys = [
+ ("enter/space", "activate option"),
+ ("C", "clear all options"),
+ ]
+ text.extend(common.format_keyvals(keys, key="key", val="text", indent=4))
+ return text
+help_context = _mkhelp()
+
class OptionWidget(urwid.WidgetWrap):
def __init__(self, option, text, shortcut, active, focus):
@@ -25,12 +34,12 @@ class OptionWidget(urwid.WidgetWrap):
text = common.highlight_key(
text,
shortcut,
- textattr=textattr,
- keyattr=keyattr
+ textattr = textattr,
+ keyattr = keyattr
)
opt = urwid.Text(text, align="center")
opt = urwid.AttrWrap(opt, textattr)
- opt = urwid.Padding(opt, align="center", width=("relative", 20))
+ opt = urwid.Padding(opt, align = "center", width = ("relative", 20))
urwid.WidgetWrap.__init__(self, opt)
def keypress(self, size, key):