16 lines
354 B
Python
16 lines
354 B
Python
from pathlib import Path
|
|
|
|
from app.core.config import settings
|
|
|
|
DATA_ROOT = Path(settings.data_root)
|
|
|
|
|
|
def ensure_data_dirs() -> None:
|
|
for name in ["uploads", "error-reports", "exports", "pdf-cache"]:
|
|
(DATA_ROOT / name).mkdir(parents=True, exist_ok=True)
|
|
|
|
|
|
def data_path(name: str) -> Path:
|
|
ensure_data_dirs()
|
|
return DATA_ROOT / name
|