Add centralized path management and sample database generator

Co-authored-by: elisiariocouto <818914+elisiariocouto@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-09-11 22:20:25 +00:00
committed by Elisiário Couto
parent 0c030efef2
commit e9711339bd
9 changed files with 635 additions and 68 deletions

View File

@@ -5,6 +5,7 @@ from pathlib import Path
from typing import Dict, Any, Optional
from loguru import logger
from leggen.utils.paths import path_manager
class Config:
@@ -23,9 +24,10 @@ class Config:
if config_path is None:
config_path = os.environ.get(
"LEGGEN_CONFIG_FILE",
str(Path.home() / ".config" / "leggen" / "config.toml"),
"LEGGEN_CONFIG_FILE"
)
if not config_path:
config_path = str(path_manager.get_config_file_path())
self._config_path = config_path
@@ -53,9 +55,10 @@ class Config:
if config_path is None:
config_path = self._config_path or os.environ.get(
"LEGGEN_CONFIG_FILE",
str(Path.home() / ".config" / "leggen" / "config.toml"),
"LEGGEN_CONFIG_FILE"
)
if not config_path:
config_path = str(path_manager.get_config_file_path())
if config_path is None:
raise ValueError("No config path specified")