This commit introduces several enhancements across multiple files to improve maintainability, functionality, and overall code quality. Key updates are as follows:
1. .gitignore
• Added exclusion for kindle/data/* to prevent Kindle-specific data from being tracked.
2. Dockerfile
• Added installation of OpenMoji font:
• Downloads and unzips OpenMoji font to /usr/share/fonts/openmoji.
• Updates font cache with fc-cache.
• Verifies installation with fc-list | grep "OpenMoji".
• Improves container setup for rendering Kindle dashboards with proper font support.
3. compose.yml
• Port mapping now uses an environment variable ${HOST_PORT} instead of hardcoding 56733:80.
• Enhances flexibility for port management.
4. kindle/ascwebdash.py
• Significant refactoring and cleanup:
• Removed unused signal handling and daemonization logic.
• Simplified logging configuration and added optional arguments using argparse for flexibility.
• Abstracted repetitive paths using constants for maintainability.
• Consolidated functionality for fetching images and refreshing the screen.
• Removed unused Wi-Fi and GUI toggling code.
• Focused the script’s functionality on image fetching and display for Kindle extensions.
5. CSS (style.css)
• Removed visual debugging borders (red, green, yellow).
• Improved layout styles:
• Set fixed widths for better rendering of event columns.
• Adjusted margins and paddings for cleaner alignment.
• Added a new .day .events class for consistent padding.
6. views.py
• Added error handling when fetching calendar data:
• Ensures the application doesn’t crash if calendar URLs are inaccessible.
• Logs errors to console for debugging.
Impact:
• Maintainability: Refactored scripts, improved code structure, and enhanced readability.
• Flexibility: Environment variable support for ports and dynamic script arguments.
• Functionality: Added OpenMoji font support in the Docker container.
• UI/UX: Cleaned up CSS for better layout and appearance.
• Resilience: Improved error handling in views.py to handle calendar fetch failures gracefully.
Files Modified:
• .gitignore
• Dockerfile
• compose.yml
• kindle/ascwebdash/bin/asc-webdash.py
• server/app/templates/style.css
• server/app/views.py
This ensures better extensibility and robustness across the codebase.
70 lines
812 B
Plaintext
70 lines
812 B
Plaintext
/test.py
|
|
|
|
kindle/data/*
|
|
|
|
__pycache__
|
|
*.py[cod]
|
|
*$py.class
|
|
|
|
# Distribution / packaging
|
|
.Python build/
|
|
develop-eggs/
|
|
dist/
|
|
downloads/
|
|
eggs/
|
|
.eggs/
|
|
lib/
|
|
lib64/
|
|
parts/
|
|
sdist/
|
|
var/
|
|
wheels/
|
|
*.egg-info/
|
|
.installed.cfg
|
|
*.egg
|
|
*.manifest
|
|
*.spec
|
|
|
|
# Log files
|
|
pip-log.txt
|
|
pip-delete-this-directory.txt
|
|
*.log
|
|
|
|
# IPython
|
|
profile_default/
|
|
ipython_config.py
|
|
|
|
# pyenv
|
|
.python-version
|
|
|
|
# pyflow
|
|
__pypackages__/
|
|
|
|
# Environment
|
|
.env
|
|
.venv
|
|
env/
|
|
venv/
|
|
ENV/
|
|
|
|
# PyCharm #
|
|
.idea/**/workspace.xml
|
|
.idea/**/tasks.xml
|
|
.idea/dictionaries
|
|
.idea/**/dataSources/
|
|
.idea/**/dataSources.ids
|
|
.idea/**/dataSources.xml
|
|
.idea/**/dataSources.local.xml
|
|
.idea/**/sqlDataSources.xml
|
|
.idea/**/dynamic.xml
|
|
.idea/**/uiDesigner.xml
|
|
.idea/**/gradle.xml
|
|
.idea/**/libraries
|
|
.idea/**
|
|
*.iws /out/
|
|
server/app/static/fonts
|
|
*.bmp
|
|
*.png
|
|
*.pngno_alpha
|
|
app/static/fonts
|