MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / ensure_runtime_dirs

Function ensure_runtime_dirs

scripts/init_db.py:15–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14# Where code lives (PROJECT_ROOT) and where runtime state belongs are the same
15# directory in a source checkout but not in an installed wheel, where
16# PROJECT_ROOT is site-packages. Writing data there loses it on upgrade.
17try:
18 from paperflow.runtime import data_dir as _resolve_data_dir
19 from paperflow.runtime import paperflow_home as _resolve_home
20
21 RUNTIME_ROOT = _resolve_home()
22 DATA_DIR = _resolve_data_dir()
23except Exception:
24 RUNTIME_ROOT = PROJECT_ROOT
25 DATA_DIR = PROJECT_ROOT / "data"
26
27
28def ensure_runtime_dirs() -> None:
29 for relative in (
30 "db_backups",
31 "embeddings_cache",
32 "papers",
33 "reading_reports",

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected