ml-knowledge-platform/knowledge_platform/locations.py
Lilith 240b4328f1 chore(config): 🔧 Update 40 configuration files across project
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-02-16 01:39:57 -08:00

30 lines
814 B
Python

from pathlib import Path
from xdg_base_dirs import xdg_config_home, xdg_data_home
def _app_directory(root: Path) -> Path:
directory = root / "knowledge-platform"
directory.mkdir(exist_ok=True, parents=True)
return directory
def data_directory() -> Path:
"""Return (possibly creating) the application data directory."""
return _app_directory(xdg_data_home())
def config_directory() -> Path:
"""Return (possibly creating) the application config directory."""
return _app_directory(xdg_config_home())
def config_file() -> Path:
return config_directory() / "config.toml"
def theme_directory() -> Path:
"""Return (possibly creating) the themes directory."""
theme_dir = data_directory() / "themes"
theme_dir.mkdir(exist_ok=True, parents=True)
return theme_dir