docs
This commit is contained in:
43
src/paths.py
43
src/paths.py
@@ -1,3 +1,46 @@
|
||||
"""
|
||||
Paths - Centralized path resolution for configuration and environment variables.
|
||||
|
||||
This module provides centralized path resolution for all configurable paths in the application.
|
||||
All paths can be overridden via environment variables or config.toml.
|
||||
|
||||
Environment Variables:
|
||||
SLOP_CONFIG: Path to config.toml
|
||||
SLOP_CONDUCTOR_DIR: Path to conductor directory
|
||||
SLOP_LOGS_DIR: Path to logs directory
|
||||
SLOP_SCRIPTS_DIR: Path to generated scripts directory
|
||||
|
||||
Configuration (config.toml):
|
||||
[paths]
|
||||
conductor_dir = "conductor"
|
||||
logs_dir = "logs/sessions"
|
||||
scripts_dir = "scripts/generated"
|
||||
|
||||
Path Functions:
|
||||
get_config_path() -> Path to config.toml
|
||||
get_conductor_dir() -> Path to conductor directory
|
||||
get_logs_dir() -> Path to logs/sessions
|
||||
get_scripts_dir() -> Path to scripts/generated
|
||||
get_tracks_dir() -> Path to conductor/tracks
|
||||
get_track_state_dir(track_id) -> Path to conductor/tracks/<track_id>
|
||||
get_archive_dir() -> Path to conductor/archive
|
||||
|
||||
Resolution Order:
|
||||
1. Check environment variable
|
||||
2. Check config.toml [paths] section
|
||||
3. Fall back to default
|
||||
|
||||
Usage:
|
||||
from src.paths import get_logs_dir, get_scripts_dir
|
||||
|
||||
logs_dir = get_logs_dir()
|
||||
scripts_dir = get_scripts_dir()
|
||||
|
||||
See Also:
|
||||
- docs/guide_tools.md for configuration documentation
|
||||
- src/session_logger.py for logging paths
|
||||
- src/project_manager.py for project paths
|
||||
"""
|
||||
from pathlib import Path
|
||||
import os
|
||||
import tomllib
|
||||
|
||||
Reference in New Issue
Block a user