MCPcopy
hub / github.com/mitmproxy/mitmproxy / load

Function load

mitmproxy/optmanager.py:548–561  ·  view source on GitHub ↗

Load configuration from text, over-writing options already set in this object. May raise OptionsError if the config file is invalid.

(opts: OptManager, text: str, cwd: Path | str | None = None)

Source from the content-addressed store, hash-verified

546
547
548def load(opts: OptManager, text: str, cwd: Path | str | None = None) -> None:
549 """
550 Load configuration from text, over-writing options already set in
551 this object. May raise OptionsError if the config file is invalid.
552 """
553 data = parse(text)
554
555 scripts = data.get("scripts")
556 if scripts is not None and cwd is not None:
557 data["scripts"] = [
558 str(relative_path(Path(path), relative_to=Path(cwd))) for path in scripts
559 ]
560
561 opts.update_defer(**data)
562
563
564def load_paths(opts: OptManager, *paths: Path | str) -> None:

Callers 1

load_pathsFunction · 0.70

Calls 5

relative_pathFunction · 0.85
PathClass · 0.85
update_deferMethod · 0.80
parseFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…