Commit Graph

5 Commits

Author SHA1 Message Date
e96ef0e44e Improve Dockerfile, compose configuration, Kindle script, and UI styles for better maintainability and functionality
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.
2024-12-17 06:59:54 -06:00
d8d9e3bbab 2024-12-16 2024-12-16 16:45:24 -06:00
82d0389db4 try fixing weather image 2024-12-16 13:43:38 -06:00
f65cf3c1ed 2024-12-16 2024-12-16 08:25:39 -06:00
35677f7e95 simplify css 2024-12-15 19:48:47 -06:00