mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
troubleshooting test script
This commit is contained in:
@@ -7,11 +7,9 @@ class ConfigManager:
|
||||
# Use current working directory as base
|
||||
self.config_path = config_path or "config/config.json"
|
||||
self.secrets_path = secrets_path or "config/config_secrets.json"
|
||||
|
||||
self.config: Dict[str, Any] = {}
|
||||
self.load_config()
|
||||
|
||||
def load_config(self) -> None:
|
||||
def load_config(self) -> Dict[str, Any]:
|
||||
"""Load configuration from JSON files."""
|
||||
try:
|
||||
# Load main config
|
||||
@@ -26,10 +24,13 @@ class ConfigManager:
|
||||
# Deep merge secrets into config
|
||||
self._deep_merge(self.config, secrets)
|
||||
|
||||
return self.config
|
||||
|
||||
except FileNotFoundError as e:
|
||||
if str(e).find('config_secrets.json') == -1: # Only raise if main config is missing
|
||||
print(f"Configuration file not found at {os.path.abspath(self.config_path)}")
|
||||
raise
|
||||
return self.config
|
||||
except json.JSONDecodeError:
|
||||
print("Error parsing configuration file")
|
||||
raise
|
||||
|
||||
@@ -15,10 +15,19 @@ def main():
|
||||
config_manager = ConfigManager()
|
||||
config = config_manager.load_config()
|
||||
|
||||
# Initialize display manager
|
||||
display_manager = DisplayManager(config.get('display', {}))
|
||||
if not config:
|
||||
print("Error: Failed to load configuration")
|
||||
return
|
||||
|
||||
display_config = config.get('display')
|
||||
if not display_config:
|
||||
print("Error: No display configuration found")
|
||||
return
|
||||
|
||||
# Initialize news manager
|
||||
# Initialize display manager
|
||||
display_manager = DisplayManager(display_config)
|
||||
|
||||
# Initialize news manager with the loaded config
|
||||
news_manager = NewsManager(config, display_manager)
|
||||
|
||||
# Test the scrolling behavior
|
||||
@@ -38,6 +47,8 @@ def main():
|
||||
print("\nTest interrupted by user")
|
||||
except Exception as e:
|
||||
print(f"Error during test: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
print("Test completed")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user