aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/grideditor.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/console/grideditor.py')
-rw-r--r--libmproxy/console/grideditor.py33
1 files changed, 21 insertions, 12 deletions
diff --git a/libmproxy/console/grideditor.py b/libmproxy/console/grideditor.py
index 2d2754b1..eb66e59e 100644
--- a/libmproxy/console/grideditor.py
+++ b/libmproxy/console/grideditor.py
@@ -132,7 +132,7 @@ class GridWalker(urwid.ListWalker):
errors = self.lst[self.focus][1]
emsg = self.editor.is_error(self.focus_col, val)
if emsg:
- signals.status_message.send(message = emsg, expire = 1000)
+ signals.status_message.send(message = emsg, expire = 1)
errors.add(self.focus_col)
else:
errors.discard(self.focus_col)
@@ -338,11 +338,20 @@ class GridEditor(urwid.WidgetWrap):
self.walker.delete_focus()
elif key == "r":
if self.walker.get_current_value() is not None:
- self.master.path_prompt("Read file: ", "", self.read_file)
+ signals.status_path_prompt.send(
+ self,
+ prompt = "Read file: ",
+ text = "",
+ callback = self.read_file
+ )
elif key == "R":
if self.walker.get_current_value() is not None:
- self.master.path_prompt(
- "Read unescaped file: ", "", self.read_file, True
+ signals.status_path_prompt.send(
+ self,
+ prompt = "Read unescaped file: ",
+ text = "",
+ callback = self.read_file,
+ args = (True,)
)
elif key == "e":
o = self.walker.get_current_value()
@@ -431,10 +440,10 @@ class HeaderEditor(GridEditor):
def handle_key(self, key):
if key == "U":
- self.master.prompt_onekey(
- "Add User-Agent header:",
- [(i[0], i[1]) for i in http_uastrings.UASTRINGS],
- self.set_user_agent,
+ signals.status_prompt_onekey.send(
+ prompt = "Add User-Agent header:",
+ keys = [(i[0], i[1]) for i in http_uastrings.UASTRINGS],
+ callback = self.set_user_agent,
)
return True
@@ -500,10 +509,10 @@ class SetHeadersEditor(GridEditor):
def handle_key(self, key):
if key == "U":
- self.master.prompt_onekey(
- "Add User-Agent header:",
- [(i[0], i[1]) for i in http_uastrings.UASTRINGS],
- self.set_user_agent,
+ signals.status_prompt_onekey.send(
+ prompt = "Add User-Agent header:",
+ keys = [(i[0], i[1]) for i in http_uastrings.UASTRINGS],
+ callback = self.set_user_agent,
)
return True