aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/flowview.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/console/flowview.py')
-rw-r--r--libmproxy/console/flowview.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py
index 0038558b..8102de55 100644
--- a/libmproxy/console/flowview.py
+++ b/libmproxy/console/flowview.py
@@ -25,8 +25,9 @@ def _mkhelp():
("A", "accept all intercepted flows"),
("a", "accept this intercepted flow"),
("b", "save request/response body"),
- ("d", "delete flow"),
("D", "duplicate flow"),
+ ("d", "delete flow"),
+ ("E", "export"),
("e", "edit request/response"),
("f", "load full body data"),
("m", "change body display mode for this entity"),
@@ -95,6 +96,7 @@ footer = [
class FlowViewHeader(urwid.WidgetWrap):
+
def __init__(self, master, f):
self.master, self.flow = master, f
self._w = common.format_flow(
@@ -217,7 +219,7 @@ class FlowView(tabs.Tabs):
txt = []
for (style, text) in line:
if total_chars + len(text) > max_chars:
- text = text[:max_chars-total_chars]
+ text = text[:max_chars - total_chars]
txt.append((style, text))
total_chars += len(text)
if total_chars == max_chars:
@@ -574,6 +576,18 @@ class FlowView(tabs.Tabs):
callback = self.master.save_one_flow,
args = (self.flow,)
)
+ elif key == "E":
+ signals.status_prompt_onekey.send(
+ self,
+ prompt = "Export",
+ keys = (
+ ("as curl command", "c"),
+ ("as python code", "p"),
+ ("as raw request", "r"),
+ ),
+ callback = common.export_prompt,
+ args = (self.flow,)
+ )
elif key == "|":
signals.status_prompt_path.send(
prompt = "Send flow to script",