From 3facdb15ca5896db2811c98e7f07a9595e7911c2 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Fri, 30 Jan 2026 05:30:57 +0000 Subject: [PATCH] Add exporters, utils, and tests --- .termflow/utils/config.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .termflow/utils/config.py diff --git a/.termflow/utils/config.py b/.termflow/utils/config.py new file mode 100644 index 0000000..1725024 --- /dev/null +++ b/.termflow/utils/config.py @@ -0,0 +1,26 @@ +"""Configuration utilities.""" + +import os +from pathlib import Path +from typing import Any, Dict, Optional + + +def load_config(config_path: Optional[str] = None) -> Dict[str, Any]: + """Load configuration from file.""" + if config_path is None: + config_path = os.environ.get("TERMFLOW_HOME", str(Path.home() / ".termflow")) + + config_file = Path(config_path) / "config.yaml" + + if config_file.exists(): + import yaml + with open(config_file) as f: + return yaml.safe_load(f) or {} + + return {} + + +def get_default_db_path() -> str: + """Get the default database path.""" + home = Path.home() + return str(home / ".termflow" / "sessions.db")