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

Function save_static

mitmproxy/tools/web/static_viewer.py:22–33  ·  view source on GitHub ↗

Save the files for the static web view.

(path: pathlib.Path)

Source from the content-addressed store, hash-verified

20
21
22def save_static(path: pathlib.Path) -> None:
23 """
24 Save the files for the static web view.
25 """
26 # We want to overwrite the static files to keep track of the update.
27 if (path / "static").exists():
28 shutil.rmtree(str(path / "static"))
29 shutil.copytree(str(web_dir / "static"), str(path / "static"))
30 shutil.copyfile(str(web_dir / "index.html"), str(path / "index.html"))
31
32 with open(str(path / "static" / "static.js"), "w") as f:
33 f.write("MITMWEB_STATIC = true;")
34
35
36def save_filter_help(path: pathlib.Path) -> None:

Callers 1

exportMethod · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…