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)
| 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( |