MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _load_local_env_file

Function _load_local_env_file

IntelOSINT.py:1895–1910  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1893
1894
1895def _load_local_env_file():
1896 env_path = Path(__file__).resolve().parent / ".env"
1897 if not env_path.exists():
1898 return
1899 try:
1900 for raw_line in env_path.read_text(encoding="utf-8").splitlines():
1901 line = raw_line.strip()
1902 if not line or line.startswith("#") or "=" not in line:
1903 continue
1904 key, value = line.split("=", 1)
1905 key = key.strip()
1906 value = value.strip().strip('"').strip("'")
1907 if key and key not in os.environ:
1908 os.environ[key] = value
1909 except Exception:
1910 print("[!] File .env presente ma non leggibile. Verifica permessi e formato.")
1911
1912
1913def _read_env_file_values(env_path: Path) -> dict:

Callers 1

IntelOSINT.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected