mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
move test files to test folder to clean up repo
This commit is contained in:
51
test/run_font_test.py
Normal file
51
test/run_font_test.py
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
from src.display_manager import DisplayManager
|
||||
from src.font_test_manager import FontTestManager
|
||||
from src.config_manager import ConfigManager
|
||||
|
||||
# Configure logging to match main application
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s.%(msecs)03d - %(levelname)s:%(name)s:%(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S'
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def main():
|
||||
"""Run the font test display."""
|
||||
try:
|
||||
# Load configuration
|
||||
config_manager = ConfigManager()
|
||||
config = config_manager.load_config()
|
||||
|
||||
# Initialize display manager
|
||||
display_manager = DisplayManager(config)
|
||||
|
||||
# Initialize font test manager
|
||||
font_test_manager = FontTestManager(config, display_manager)
|
||||
|
||||
logger.info("Starting static font test display. Press Ctrl+C to exit.")
|
||||
|
||||
# Display all font sizes at once
|
||||
font_test_manager.display()
|
||||
|
||||
# Keep the display running until user interrupts
|
||||
try:
|
||||
while True:
|
||||
time.sleep(1) # Sleep to prevent CPU hogging
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Font test display stopped by user.")
|
||||
finally:
|
||||
# Clean up
|
||||
display_manager.clear()
|
||||
display_manager.cleanup()
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error running font test display: {e}", exc_info=True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user