mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-26 05:06:37 -07:00
Fixed GDM installation, reworked label_files.py, fixed theme removing
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user