mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-06 19:28:06 +00:00
chore: remove manager-era NBA test files and one-off debug scripts
The four test_nba_*.py files imported nba_managers, leaderboard_manager and odds_manager — top-level modules deleted when sports displays became plugins — inside try/except blocks that swallowed the ImportError, so they passed while exercising nothing. test_nba_data_structure.py and debug_nba_api.py (a diagnostic script living in test/) made live ESPN API calls rather than testing repo code. None were enrolled in CI. scripts/debug/direct_fix_imports.py and check_imports.py were one-shot artifacts that edited/inspected a hardcoded ~/LEDMatrix/web_interface/ app.py to fix an import problem solved long ago; nothing references them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXb4mKcAkVaxkeTb3YnAdr
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Check what imports are actually in the app.py file on the Pi
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
# Read the app.py file and check the import lines
|
||||
app_py_path = Path.home() / 'LEDMatrix' / 'web_interface' / 'app.py'
|
||||
|
||||
print(f"🔍 Checking imports in: {app_py_path}")
|
||||
print(f"📁 File exists: {app_py_path.exists()}")
|
||||
|
||||
if app_py_path.exists():
|
||||
with open(app_py_path, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
print("\n🔍 Import lines in app.py:")
|
||||
for i, line in enumerate(lines, 1):
|
||||
if 'from' in line and 'blueprints' in line and 'import' in line:
|
||||
print(f" Line {i}: {line.strip()}")
|
||||
|
||||
print("\n🔍 Blueprint registration lines:")
|
||||
for i, line in enumerate(lines, 1):
|
||||
if 'register_blueprint' in line:
|
||||
print(f" Line {i}: {line.strip()}")
|
||||
else:
|
||||
print("❌ app.py file not found!")
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Direct fix for import issues - manually edit the app.py file
|
||||
"""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
def fix_imports():
|
||||
app_py_path = Path.home() / 'LEDMatrix' / 'web_interface' / 'app.py'
|
||||
|
||||
print(f"🔧 Directly fixing imports in: {app_py_path}")
|
||||
|
||||
# Read the file
|
||||
with open(app_py_path, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
# Find and fix the import lines
|
||||
fixed = False
|
||||
for i, line in enumerate(lines, 1):
|
||||
if 'from blueprints.pages_v3 import' in line:
|
||||
lines[i-1] = "from web_interface.blueprints.pages_v3 import pages_v3\n"
|
||||
print(f"✅ Fixed line {i}: from blueprints.pages_v3 import → from web_interface.blueprints.pages_v3 import")
|
||||
fixed = True
|
||||
elif 'from blueprints.api_v3 import' in line:
|
||||
lines[i-1] = "from web_interface.blueprints.api_v3 import api_v3\n"
|
||||
print(f"✅ Fixed line {i}: from blueprints.api_v3 import → from web_interface.blueprints.api_v3 import")
|
||||
fixed = True
|
||||
|
||||
if not fixed:
|
||||
print("❌ No import lines found to fix")
|
||||
return False
|
||||
|
||||
# Write the fixed file back
|
||||
with open(app_py_path, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
print("✅ File updated successfully")
|
||||
return True
|
||||
|
||||
def verify_fix():
|
||||
print("\n🔍 Verifying the fix...")
|
||||
os.system("python3 check_imports.py")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if fix_imports():
|
||||
print("\n🧹 Clearing Python cache...")
|
||||
os.system("find ~/LEDMatrix -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true")
|
||||
os.system("find ~/LEDMatrix -name '*.pyc' -delete 2>/dev/null || true")
|
||||
|
||||
print("\n✅ Imports fixed and cache cleared!")
|
||||
verify_fix()
|
||||
|
||||
print("\n🚀 Now try running the web interface:")
|
||||
print("cd ~/LEDMatrix")
|
||||
print("python3 web_interface/start.py")
|
||||
else:
|
||||
print("\n❌ Fix failed")
|
||||
Reference in New Issue
Block a user