gambling updates

This commit is contained in:
Chuck
2025-07-18 22:12:33 -05:00
parent 88d6f577ef
commit aa379e8369
12 changed files with 423 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import json
import os
from typing import Dict, Any
from typing import Dict, Any, Optional
class ConfigManager:
def __init__(self, config_path: str = None, secrets_path: str = None):
@@ -93,6 +93,18 @@ class ConfigManager:
print(f"An unexpected error occurred while saving configuration: {str(e)}")
raise
def get_secret(self, key: str) -> Optional[Any]:
"""Get a secret value by key."""
try:
if not os.path.exists(self.secrets_path):
return None
with open(self.secrets_path, 'r') as f:
secrets = json.load(f)
return secrets.get(key)
except (json.JSONDecodeError, IOError) as e:
print(f"Error reading secrets file: {e}")
return None
def _deep_merge(self, target: Dict, source: Dict) -> None:
"""Deep merge source dict into target dict."""
for key, value in source.items():