INNER CODE UNIT · Python
load_config
nirholas/XActions · python/xeepy/cli/main.py:43
def load_config(config_path: str) -> dict[str, Any]:
"""Load configuration from file."""
import yaml
path = Path(config_path)
if not path.exists():
# Try default locations
for default_path in ["config.yaml", "~/.xeepy/config.yaml"]:
expanded = Path(default_path).expanduser()
if expanded.exists():
path = expanded
break
if path.exists():
with open(path) as f:
return yaml.safe_load(f) or {}