1
0
Fourche 0
MQL5-Google-Onedrive/scripts/common/paths.py
copilot-swe-agent[bot] e7f2d678e2 Add shared utilities and refactor AI client duplications
Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-02-11 08:36:58 +00:00

30 lignes
748 o
Python

"""
Shared path definitions for automation scripts.
Centralizes path resolution logic.
"""
from pathlib import Path
# Repository root - one level up from scripts directory
REPO_ROOT = Path(__file__).resolve().parents[2]
# Common directories
SCRIPTS_DIR = REPO_ROOT / "scripts"
CONFIG_DIR = REPO_ROOT / "config"
DOCS_DIR = REPO_ROOT / "docs"
DATA_DIR = REPO_ROOT / "data"
LOGS_DIR = REPO_ROOT / "logs"
MT5_DIR = REPO_ROOT / "mt5" / "MQL5"
DASHBOARD_DIR = REPO_ROOT / "dashboard"
def ensure_dirs(*dirs: Path) -> None:
"""
Ensure directories exist, creating them if necessary.
Args:
*dirs: Variable number of Path objects to create
"""
for directory in dirs:
directory.mkdir(parents=True, exist_ok=True)