From 97cd036350f87bc733a769f99ac485169231e871 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Tue, 24 Jun 2025 17:29:17 +0300 Subject: [PATCH] config --- core/config.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/config.py b/core/config.py index f86b26f..2a7616e 100644 --- a/core/config.py +++ b/core/config.py @@ -236,6 +236,15 @@ def get_config(config_path: str = "config.yaml") -> Config: _config_instance = Config(config_path) return _config_instance +def load_config(config_path: str = "config.yaml") -> Dict[str, Any]: + """Load configuration from YAML file""" + try: + config = get_config(config_path) + return config._config + except Exception as e: + logger.error(f"Error loading configuration: {e}") + return {} + def setup_logging(config: Optional[Config] = None): """Setup logging based on configuration""" if config is None: @@ -257,4 +266,13 @@ def setup_logging(config: Optional[Config] = None): ] ) - logger.info("Logging configured successfully") \ No newline at end of file + logger.info("Logging configured successfully") + +def load_config(config_path: str = "config.yaml") -> Dict[str, Any]: + """Load configuration from YAML file""" + try: + config = get_config(config_path) + return config._config + except Exception as e: + logger.error(f"Error loading configuration: {e}") + return {}