From faa644ef3f49c042ecfd6ebcafb530fbf56b62bc Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:08:07 -0500 Subject: [PATCH] More structure changes More root structure changes to run easier from root folder --- src/clock.py | 4 ++-- src/config_manager.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/clock.py b/src/clock.py index 140e9248..72b84177 100644 --- a/src/clock.py +++ b/src/clock.py @@ -2,8 +2,8 @@ import time from datetime import datetime import pytz from typing import Dict, Any -from config_manager import ConfigManager -from display_manager import DisplayManager +from src.config_manager import ConfigManager +from src.display_manager import DisplayManager class Clock: def __init__(self): diff --git a/src/config_manager.py b/src/config_manager.py index 9fe0e817..b0daf477 100644 --- a/src/config_manager.py +++ b/src/config_manager.py @@ -3,9 +3,14 @@ import os from typing import Dict, Any class ConfigManager: - def __init__(self, config_path: str = "../config/config.json", secrets_path: str = "../config/config_secrets.json"): - self.config_path = config_path - self.secrets_path = secrets_path + def __init__(self, config_path: str = None, secrets_path: str = None): + # Get the project root directory + project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + # Set default paths relative to project root + self.config_path = config_path or os.path.join(project_root, "config", "config.json") + self.secrets_path = secrets_path or os.path.join(project_root, "config", "config_secrets.json") + self.config: Dict[str, Any] = {} self.load_config()