MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / _load_env_manually

Function _load_env_manually

script/cli_env.py:20–32  ·  view source on GitHub ↗
(env_file: Path)

Source from the content-addressed store, hash-verified

18
19
20def _load_env_manually(env_file: Path) -> None:
21 for raw_line in env_file.read_text(encoding="utf-8").splitlines():
22 line = raw_line.strip()
23 if not line or line.startswith("#") or "=" not in line:
24 continue
25 key, value = line.split("=", 1)
26 key = key.strip()
27 value = value.strip()
28 if not key:
29 continue
30 if len(value) >= 2 and value[0] == value[-1] and value[0] in {"'", '"'}:
31 value = value[1:-1]
32 os.environ.setdefault(key, value)
33
34
35def load_project_env() -> None:

Callers 1

load_project_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected