MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / __call__

Method __call__

mitmproxy/tools/console/commandexecutor.py:14–35  ·  view source on GitHub ↗
(self, cmd: str)

Source from the content-addressed store, hash-verified

12 self.master = master
13
14 def __call__(self, cmd: str) -> None:
15 if cmd.strip():
16 try:
17 ret = self.master.commands.execute(cmd)
18 except exceptions.CommandError as e:
19 logging.error(str(e))
20 else:
21 if ret is not None:
22 if type(ret) == Sequence[flow.Flow]: # noqa: E721
23 signals.status_message.send(
24 message="Command returned %s flows" % len(ret)
25 )
26 elif type(ret) is flow.Flow:
27 signals.status_message.send(message="Command returned 1 flow")
28 else:
29 self.master.overlay(
30 overlay.DataViewerOverlay(
31 self.master,
32 ret,
33 ),
34 valign="top",
35 )

Callers

nothing calls this directly

Calls 4

executeMethod · 0.80
overlayMethod · 0.80
errorMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected