diff --git a/src/background_data_service.py b/src/background_data_service.py index 8293879c..64ba35f4 100644 --- a/src/background_data_service.py +++ b/src/background_data_service.py @@ -223,7 +223,7 @@ class BackgroundDataService: self.stats['cache_misses'] += 1 # Submit to executor - future = self.executor.submit(self._fetch_data_worker, request) + self.executor.submit(self._fetch_data_worker, request) logger.info(f"Submitted background fetch request {request_id} for {sport} {year}") return request_id diff --git a/src/base_classes/baseball.py b/src/base_classes/baseball.py index 6bfeb5aa..9a46dd5a 100644 --- a/src/base_classes/baseball.py +++ b/src/base_classes/baseball.py @@ -329,7 +329,6 @@ class Baseball(SportsCore): return series_summary = game.get("series_summary", "") - font = self.fonts.get('detail', ImageFont.load_default()) bbox = draw_overlay.textbbox((0, 0), series_summary, font=self.fonts['time']) height = bbox[3] - bbox[1] shots_y = (self.display_height - height) // 2 diff --git a/src/base_classes/hockey.py b/src/base_classes/hockey.py index c49f9547..9c25da35 100644 --- a/src/base_classes/hockey.py +++ b/src/base_classes/hockey.py @@ -77,8 +77,6 @@ class Hockey(SportsCore): away_shots = round(home_team_saves / home_team_saves_per) if away_team_saves_per > 0: home_shots = round(away_team_saves / away_team_saves_per) - status_short = status["type"].get("shortDetail", "") - if situation and status["type"]["state"] == "in": # Detect scoring events from status detail # status_detail = status["type"].get("detail", "") diff --git a/src/common/cli.py b/src/common/cli.py index e93a61b4..ec33caaa 100644 --- a/src/common/cli.py +++ b/src/common/cli.py @@ -63,12 +63,12 @@ def test_utilities(display_width: int, display_height: int): # Test GameHelper print("Testing GameHelper...") - game_helper = GameHelper() + GameHelper() print("GameHelper initialized") - + # Test ConfigHelper print("Testing ConfigHelper...") - config_helper = ConfigHelper() + ConfigHelper() print("ConfigHelper initialized") print("All tests passed!") diff --git a/src/common/display_helper.py b/src/common/display_helper.py index cf27e5e2..5d65f0b4 100644 --- a/src/common/display_helper.py +++ b/src/common/display_helper.py @@ -166,8 +166,7 @@ class DisplayHelper: img = self.create_base_image(background_color) draw = ImageDraw.Draw(img) - # Calculate text position (start off-screen to the right) - text_width = draw.textlength(text, font=font) + # Start text off-screen to the right x_position = self.display_width # Draw text @@ -216,8 +215,7 @@ class DisplayHelper: PIL Image with error message """ img = self.create_base_image((50, 0, 0)) # Dark red background - draw = ImageDraw.Draw(img) - + # Use default font font = ImageFont.load_default() diff --git a/src/config_manager.py b/src/config_manager.py index 00e27b50..cd022b52 100644 --- a/src/config_manager.py +++ b/src/config_manager.py @@ -313,17 +313,8 @@ class ConfigManager: self._merge_template_defaults(self.config, template_config) # Save migrated config using atomic save to preserve permissions - # Load secrets if they exist to pass to atomic save - secrets_content = {} - if os.path.exists(self.secrets_path): - try: - with open(self.secrets_path, 'r') as f_secrets: - secrets_content = json.load(f_secrets) - except Exception: - pass # Continue without secrets if can't load - # Use atomic save to preserve file permissions - # Note: save_config_atomic handles secrets internally, no need to pass new_secrets + # Note: save_config_atomic handles secrets internally result = self.save_config_atomic( new_config_data=self.config, create_backup=False, # Already created backup above diff --git a/src/display_manager.py b/src/display_manager.py index e3ab8898..174b66b3 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -58,8 +58,6 @@ class DisplayManager: def _setup_matrix(self): """Initialize the RGB matrix with configuration settings.""" - setup_start = time.time() - try: # Allow callers (e.g., web UI) to force non-hardware fallback mode if getattr(self, '_force_fallback', False): diff --git a/src/font_manager.py b/src/font_manager.py index 6d65c1fc..6372fd6c 100644 --- a/src/font_manager.py +++ b/src/font_manager.py @@ -697,8 +697,6 @@ class FontManager: fonts_dir = Path("assets/fonts") ensure_directory_permissions(fonts_dir, get_assets_dir_mode()) - target_path = os.path.join(fonts_dir, f"{family_name}.{font_file_path.rsplit('.', 1)[-1]}") - # Add to catalog self.font_catalog[family_name] = font_file_path self.clear_cache() @@ -744,11 +742,11 @@ class FontManager: if font_path.endswith('.bdf'): # Try to load BDF font - face = freetype.Face(font_path) + freetype.Face(font_path) return {"valid": True, "type": "bdf", "family": "unknown"} elif font_path.endswith('.ttf'): # Try to load TTF font - font = ImageFont.truetype(font_path, 12) + ImageFont.truetype(font_path, 12) return {"valid": True, "type": "ttf", "family": "unknown"} else: return {"valid": False, "error": "Unsupported font format"} diff --git a/src/font_test_manager.py b/src/font_test_manager.py index 222f606b..8869ebbd 100644 --- a/src/font_test_manager.py +++ b/src/font_test_manager.py @@ -79,10 +79,6 @@ class FontTestManager: # Clear the display self.display_manager.clear() - # Get display dimensions - width = self.display_manager.matrix.width - height = self.display_manager.matrix.height - # Draw font name at the top self.display_manager.draw_text(self.current_config['display_name'], y=2, color=(255, 255, 255)) diff --git a/src/plugin_system/state_reconciliation.py b/src/plugin_system/state_reconciliation.py index c6ad9c2a..c512cfe6 100644 --- a/src/plugin_system/state_reconciliation.py +++ b/src/plugin_system/state_reconciliation.py @@ -285,7 +285,6 @@ class StateReconciliation: config = config_state.get(plugin_id, {}) disk = disk_state.get(plugin_id, {}) - manager = manager_state.get(plugin_id, {}) state_mgr = state_manager_state.get(plugin_id, {}) # Check: Plugin exists on disk but not in config diff --git a/src/plugin_system/store_manager.py b/src/plugin_system/store_manager.py index 57b24b21..6ada0ab1 100644 --- a/src/plugin_system/store_manager.py +++ b/src/plugin_system/store_manager.py @@ -1728,7 +1728,7 @@ class PluginStoreManager: try: self.logger.info(f"Installing dependencies for {plugin_path.name}") - result = subprocess.run( + subprocess.run( ['pip3', 'install', '--break-system-packages', '-r', str(requirements_file)], check=True, capture_output=True, diff --git a/web_interface/blueprints/pages_v3.py b/web_interface/blueprints/pages_v3.py index bbfab66e..fc4a2988 100644 --- a/web_interface/blueprints/pages_v3.py +++ b/web_interface/blueprints/pages_v3.py @@ -37,8 +37,6 @@ def index(): secrets_config_json = "{}" main_config_data = {} secrets_config_data = {} - main_config_path = "" - secrets_config_path = "" return render_template('v3/index.html', schedule_config=schedule_config,