MCPcopy Create free account
hub / github.com/defold/defold / _bootstrap_python_paths

Function _bootstrap_python_paths

scripts/project_synth/proto.py:8–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def _bootstrap_python_paths() -> None:
9 root = Path(__file__).resolve().parents[2]
10 candidates = []
11
12 dynamo_home = os.environ.get("DYNAMO_HOME")
13 if dynamo_home:
14 dynamo_home_path = Path(dynamo_home)
15 candidates.extend(
16 [
17 dynamo_home_path / "lib" / "python",
18 dynamo_home_path / "ext" / "lib" / "python",
19 ]
20 )
21
22 candidates.extend(
23 [
24 root / "tmp" / "dynamo_home" / "lib" / "python",
25 root / "tmp" / "dynamo_home" / "ext" / "lib" / "python",
26 ]
27 )
28
29 for candidate in candidates:
30 if candidate.is_dir():
31 candidate_str = str(candidate)
32 if candidate_str not in sys.path:
33 sys.path.insert(0, candidate_str)
34
35
36_bootstrap_python_paths()

Callers 1

proto.pyFile · 0.85

Calls 3

getMethod · 0.65
extendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected