MCPcopy
hub / github.com/mitmproxy/mitmproxy / make

Function make

mitmproxy/tools/console/quickhelp.py:52–166  ·  view source on GitHub ↗
(
    widget: type[urwid.Widget],
    focused_flow: flow.Flow | None,
    is_root_widget: bool,
)

Source from the content-addressed store, hash-verified

50
51
52def make(
53 widget: type[urwid.Widget],
54 focused_flow: flow.Flow | None,
55 is_root_widget: bool,
56) -> QuickHelp:
57 top_label = ""
58 top_items: HelpItems = {}
59 if widget in (FlowListBox, FlowView):
60 top_label = "Flow:"
61 if focused_flow:
62 if widget == FlowListBox:
63 top_items["Select"] = "Select"
64 else:
65 top_items["Edit"] = "Edit a flow component"
66 top_items |= {
67 "Duplicate": "Duplicate flow",
68 "Replay": "Replay this flow",
69 "Export": "Export this flow to file",
70 "Delete": "Delete flow from view",
71 }
72 if widget == FlowListBox:
73 if focused_flow.marked:
74 top_items["Unmark"] = "Toggle mark on this flow"
75 else:
76 top_items["Mark"] = "Toggle mark on this flow"
77 top_items["Edit"] = "Edit a flow component"
78 if focused_flow.intercepted:
79 top_items["Resume"] = "Resume this intercepted flow"
80 if focused_flow.modified():
81 top_items["Restore"] = "Revert changes to this flow"
82 if isinstance(focused_flow, HTTPFlow) and focused_flow.response:
83 top_items["Save body"] = "Save response body to file"
84 if widget == FlowView:
85 top_items |= {
86 "Next flow": "Go to next flow",
87 "Prev flow": "Go to previous flow",
88 }
89 else:
90 top_items |= {
91 "Load flows": "Load flows from file",
92 "Create new": "Create a new flow",
93 }
94 elif widget == KeyBindings:
95 top_label = "Keybindings:"
96 top_items |= {
97 "Add": "Add a key binding",
98 "Edit": "Edit the currently focused key binding",
99 "Delete": "Unbind the currently focused key binding",
100 "Execute": "Execute the currently focused key binding",
101 }
102 elif widget == Options:
103 top_label = "Options:"
104 top_items |= {
105 "Edit": BasicKeyHelp("⏎"),
106 "Reset": "Reset this option",
107 "Reset all": "Reset all options",
108 "Load file": "Load from file",
109 "Save file": "Save to file",

Callers

nothing calls this directly

Calls 3

BasicKeyHelpClass · 0.85
QuickHelpClass · 0.85
modifiedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…