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

Method setvalue_toggle

mitmproxy/addons/view.py:390–400  ·  view source on GitHub ↗

Toggle a boolean value in the settings store, setting the value to the string "true" or "false".

(self, flows: Sequence[mitmproxy.flow.Flow], key: str)

Source from the content-addressed store, hash-verified

388
389 @command.command("view.settings.setval.toggle")
390 def setvalue_toggle(self, flows: Sequence[mitmproxy.flow.Flow], key: str) -> None:
391 """
392 Toggle a boolean value in the settings store, setting the value to
393 the string "true" or "false".
394 """
395 updated = []
396 for f in flows:
397 current = self.settings[f].get(key, "false")
398 self.settings[f][key] = "false" if current == "true" else "true"
399 updated.append(f)
400 ctx.master.addons.trigger(hooks.UpdateHook(updated))
401
402 @command.command("view.settings.setval")
403 def setvalue(

Callers 1

test_setgetvalFunction · 0.95

Calls 3

triggerMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by 1

test_setgetvalFunction · 0.76