Fixed GDM installation, reworked label_files.py, fixed theme removing

This commit is contained in:
Vladyslav Hroshev
2025-04-01 13:23:46 +03:00
parent 860cacaa2c
commit e5f8662269
8 changed files with 100 additions and 70 deletions

View File

@@ -1,11 +1,13 @@
import argparse
from abc import ABC, abstractmethod
from scripts.install.colors_definer import ColorsDefiner
from scripts.theme import Theme
from scripts.tweaks_manager import TweaksManager
class ThemeInstaller:
class ThemeInstaller(ABC):
"""Base class for theme installers"""
theme: Theme
def __init__(self, args: argparse.Namespace, colors: ColorsDefiner):
@@ -14,24 +16,39 @@ class ThemeInstaller:
self.stop_after_first_installed_color = False
self._define_theme()
@abstractmethod
def remove(self):
"""Method for removing already installed themes"""
pass
def install(self):
self.theme.prepare()
self._apply_tweaks_to_theme()
self._apply_colors()
self._after_install()
@abstractmethod
def _define_theme(self):
"""Here is the place to define the theme object"""
pass
def _install_theme(self, hue, theme_name, sat):
pass
@abstractmethod
def _apply_tweaks_to_theme(self):
"""Should apply the tweaks for prepared theme"""
pass
@abstractmethod
def _install_theme(self, hue, theme_name, sat):
"""Should say how to install the defined theme"""
pass
@abstractmethod
def _after_install(self):
"""Method to be called after the theme is installed. Can be used for logging or other actions"""
pass
def _apply_tweaks(self, theme):
"""This method should be called in the _apply_tweaks_to_theme method"""
tweaks_manager = TweaksManager()
tweaks_manager.apply_tweaks(self.args, theme, self.colors)