MCPcopy
hub / github.com/mitmproxy/mitmproxy / add_option

Method add_option

mitmproxy/optmanager.py:122–131  ·  view source on GitHub ↗
(
        self,
        name: str,
        typespec: type | object,
        default: Any,
        help: str,
        choices: Sequence[str] | None = None,
    )

Source from the content-addressed store, hash-verified

120 self._options: dict[str, Any] = {}
121
122 def add_option(
123 self,
124 name: str,
125 typespec: type | object,
126 default: Any,
127 help: str,
128 choices: Sequence[str] | None = None,
129 ) -> None:
130 self._options[name] = _Option(name, typespec, default, help, choices)
131 self.changed.send(updated={name})
132
133 @contextlib.contextmanager
134 def rollback(self, updated, reraise=False):

Callers

nothing calls this directly

Calls 2

_OptionClass · 0.85
sendMethod · 0.45

Tested by

no test coverage detected