mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
fix #1358
This commit is contained in:
parent
64e16f5112
commit
60d2e14cb9
@ -317,11 +317,9 @@ class FlowListWalker(urwid.ListWalker):
|
||||
class FlowListBox(urwid.ListBox):
|
||||
|
||||
def __init__(self, master):
|
||||
# type: (mitmproxy.console.master.ConsoleMaster) -> None
|
||||
self.master = master
|
||||
urwid.ListBox.__init__(
|
||||
self,
|
||||
FlowListWalker(master, master.state)
|
||||
)
|
||||
super(FlowListBox, self).__init__(FlowListWalker(master, master.state))
|
||||
|
||||
def get_method_raw(self, k):
|
||||
if k:
|
||||
@ -395,13 +393,13 @@ class FlowListBox(urwid.ListBox):
|
||||
elif key == "F":
|
||||
self.master.toggle_follow_flows()
|
||||
elif key == "W":
|
||||
if self.master.stream:
|
||||
self.master.stop_stream()
|
||||
if self.master.options.outfile:
|
||||
self.master.options.outfile = None
|
||||
else:
|
||||
signals.status_prompt_path.send(
|
||||
self,
|
||||
prompt = "Stream flows to",
|
||||
callback = self.master.start_stream_to_path
|
||||
prompt="Stream flows to",
|
||||
callback= lambda path: self.master.options.update(outfile=(path, "ab"))
|
||||
)
|
||||
else:
|
||||
return urwid.ListBox.keypress(self, size, key)
|
||||
|
@ -116,10 +116,12 @@ class ActionBar(urwid.WidgetWrap):
|
||||
class StatusBar(urwid.WidgetWrap):
|
||||
|
||||
def __init__(self, master, helptext):
|
||||
self.master, self.helptext = master, helptext
|
||||
# type: (mitmproxy.console.master.ConsoleMaster, object) -> None
|
||||
self.master = master
|
||||
self.helptext = helptext
|
||||
self.ab = ActionBar()
|
||||
self.ib = urwid.WidgetWrap(urwid.Text(""))
|
||||
self._w = urwid.Pile([self.ib, self.ab])
|
||||
super(StatusBar, self).__init__(urwid.Pile([self.ib, self.ab]))
|
||||
signals.update_settings.connect(self.sig_update_settings)
|
||||
signals.flowlist_change.connect(self.sig_update_settings)
|
||||
master.options.changed.connect(self.sig_update_settings)
|
||||
@ -224,7 +226,7 @@ class StatusBar(urwid.WidgetWrap):
|
||||
r.append("cripts:%s]" % len(self.master.options.scripts))
|
||||
|
||||
if self.master.options.outfile:
|
||||
r.append("[W:%s]" % self.master.outfile[0])
|
||||
r.append("[W:%s]" % self.master.options.outfile[0])
|
||||
|
||||
return r
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user