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

Method parse

mitmproxy/types.py:365–374  ·  view source on GitHub ↗
(self, manager: "CommandManager", t: type, s: str)

Source from the content-addressed store, hash-verified

363 display = "flow"
364
365 def parse(self, manager: "CommandManager", t: type, s: str) -> flow.Flow:
366 try:
367 flows = manager.call_strings("view.flows.resolve", [s])
368 except exceptions.CommandError as e:
369 raise ValueError(str(e)) from e
370 if len(flows) != 1:
371 raise ValueError(
372 "Command requires one flow, specification matched %s." % len(flows)
373 )
374 return flows[0]
375
376 def is_valid(self, manager: "CommandManager", typ: Any, val: Any) -> bool:
377 return isinstance(val, flow.Flow)

Callers

nothing calls this directly

Calls 1

call_stringsMethod · 0.80

Tested by

no test coverage detected