Configuration
themes.d Directory
The themes.d directory serves as the repository for your theme files. By default, the Theme Manager looks for theme files in this directory unless specified otherwise.
Configuration File (hue.config)
The configuration file hue.config stores essential settings for the Theme Manager, including:
default_theme: Specifies the default theme to load if none is specified explicitly.themes_dir: Defines the directory where theme files (*.theme) are stored.manifest_file: Indicates the file (MANIFEST) containing theme hashes for validation.log_file: Path to the log file (theme.log) for recording theme management activities.
Ensure hue.config is correctly configured to align with your environment and requirements.
Usage
Importing the Theme Object
To utilize themes in your script, import the Theme object from the src module:
from src import Theme
Managing Themes
Loading a Theme
You can load a theme using its file name or the default theme specified in hue.config:
theme_manager = ThemeManager()
theme = theme_manager.get_theme_instance('my_theme.theme') # Load specific theme
Validating a Theme
Validate a theme against its hash in the manifest file to ensure integrity:
theme_manager = ThemeManager()
valid = theme_manager.validate_theme('my_theme.theme') # Validate specific theme
Useful Tidbits
- Dynamic Theme Loading: Themes are dynamically loaded and can be swapped during runtime based on your application's needs.
- Logging: The Theme Manager logs activities to
theme.log, providing visibility into theme loading and validation operations. - Extensibility: Customize
hue.configand extend theThemeclass as per your project's thematic requirements.
Example
hue import ThemeManager
# Initialize ThemeManager instance
theme_manager = ThemeManager()
theme_manager.setup_logging()
# Load and validate a specific theme
theme = theme_manager.get_theme_instance('my_theme.theme')
if theme:
print(f"Loaded theme: {theme.list_theme_attributes()}")
# Validate the loaded theme
valid = theme_manager.validate_theme('my_theme.theme')
if valid:
print("Theme validated successfully.")
else:
print("Failed to validate theme.")
Metadata
Release files for huefy 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| huefy-1.3.0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| huefy-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.8 kB
Release files / huefy-1.3.0.tar.gz
| Download URL | huefy-1.3.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb53157fba94504d812b54e4d608d40ec3ec202131213b6986c9a44df468cec5
|
|
BLAKE2b-256 checksum How to use checksums |
a9ab8a9da03356d84c54996e7e241e82c2c763783a73acf57831168ce8ee5107
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / huefy-1.3.0-py3-none-any.whl
| Download URL | huefy-1.3.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b84c9374612cbb5c2029cc6aeefbca5f32a6cdeec851352fb691e2501ed8c8bb
|
|
BLAKE2b-256 checksum How to use checksums |
6536b78c79791dcc0c2a7bc00960a0c6f14daf1cdcac167e267b52308620a313
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|