MCPcopy
hub / github.com/mitmproxy/mitmproxy / set

Method set

mitmproxy/addons/core.py:38–52  ·  view source on GitHub ↗

Set an option. When the value is omitted, booleans are set to true, strings and integers are set to None (if permitted), and sequences are emptied. Boolean values can be true, false or toggle. Multiple values are concatenated with a single space.

(self, option: str, *value: str)

Source from the content-addressed store, hash-verified

36
37 @command.command("set")
38 def set(self, option: str, *value: str) -> None:
39 """
40 Set an option. When the value is omitted, booleans are set to true,
41 strings and integers are set to None (if permitted), and sequences
42 are emptied. Boolean values can be true, false or toggle.
43 Multiple values are concatenated with a single space.
44 """
45 if value:
46 specs = [f"{option}={v}" for v in value]
47 else:
48 specs = [option]
49 try:
50 ctx.options.set(*specs)
51 except exceptions.OptionsError as e:
52 raise exceptions.CommandError(e) from e
53
54 @command.command("flow.resume")
55 def resume(self, flows: Sequence[flow.Flow]) -> None:

Callers 15

test_optionFunction · 0.45
test_setFunction · 0.45
commander_tctxFunction · 0.45
load_flowMethod · 0.45
resumeMethod · 0.45
__init__Method · 0.45
disarmMethod · 0.45
serveFunction · 0.45
handle_hookMethod · 0.45
MaFunction · 0.45

Calls

no outgoing calls

Tested by 5

test_optionFunction · 0.36
test_setFunction · 0.36
commander_tctxFunction · 0.36
load_flowMethod · 0.36