Covered Theme module with tests

- Extracted `ColorReplacementGenerator`;
- Extracted `ColorConverterImpl`;
- Added documentation to some classes;
- `hex_to_rgba` now supports shorthand hex colors (#fff).
This commit is contained in:
Vladyslav Hroshev
2025-04-11 22:53:30 +03:00
parent 29485ddf1e
commit abfe1f5962
25 changed files with 877 additions and 103 deletions

View File

@@ -1,5 +1,4 @@
import os
import warnings
from scripts.utils import replace_keywords
from scripts.utils.theme.theme_temp_manager import ThemeTempManager
@@ -45,11 +44,10 @@ class ThemePreparation:
"""
Extract theme from source folder and prepare it for installation.
"""
self.file_manager.prepare_files(self.sources_location)
self.file_manager.copy_to_temp(self.sources_location)
self.style_manager.generate_combined_styles(self.sources_location, self.temp_folder)
self.file_manager.cleanup()
@warnings.deprecated
def replace_filled_keywords(self):
"""
Replace keywords in the theme files for filled mode.
@@ -62,4 +60,4 @@ class ThemePreparation:
("BUTTON_ACTIVE", "ACCENT-FILLED_ACTIVE"),
("BUTTON_INSENSITIVE", "ACCENT-FILLED_INSENSITIVE"),
("BUTTON-TEXT-COLOR", "TEXT-BLACK-COLOR"),
("BUTTON-TEXT_SECONDARY", "TEXT-BLACK_SECONDARY"))
("BUTTON-TEXT_SECONDARY", "TEXT-BLACK_SECONDARY"))