mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
Added functionality to write marked flows to file
w (write) -> m (marked)
This commit is contained in:
parent
122ee88021
commit
486177edc7
@ -595,6 +595,13 @@ class ConsoleMaster(flow.FlowMaster):
|
||||
def save_flows(self, path):
|
||||
return self._write_flows(path, self.state.view)
|
||||
|
||||
def save_marked_flows(self, path):
|
||||
marked_flows = []
|
||||
for f in self.state.view:
|
||||
if f.marked:
|
||||
marked_flows.append(f)
|
||||
return self._write_flows(path, marked_flows)
|
||||
|
||||
def load_flows_callback(self, path):
|
||||
if not path:
|
||||
return
|
||||
|
@ -121,6 +121,11 @@ class ConnectionItem(urwid.WidgetWrap):
|
||||
prompt = "Save all flows to",
|
||||
callback = self.master.save_flows
|
||||
)
|
||||
elif k == "m":
|
||||
signals.status_prompt_path.send(
|
||||
prompt = "Save marked flows to",
|
||||
callback = self.master.save_marked_flows
|
||||
)
|
||||
else:
|
||||
signals.status_prompt_path.send(
|
||||
prompt = "Save this flow to",
|
||||
@ -220,6 +225,7 @@ class ConnectionItem(urwid.WidgetWrap):
|
||||
keys = (
|
||||
("all flows", "a"),
|
||||
("this flow", "t"),
|
||||
("marked flows", "m"),
|
||||
),
|
||||
callback = self.save_flows_prompt,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user