Refactor GDM module to correspond SOLID principles

- I don't know how I will support this hell ahh code;
- Added some methods to gnome_shell_theme_builder.py;
- Added "color" property "install" method from theme_base.py.
This commit is contained in:
Vladyslav Hroshev
2025-04-12 23:30:34 +03:00
parent 48d10df4b1
commit ca4e4d4cbe
17 changed files with 674 additions and 202 deletions

View File

@@ -11,6 +11,9 @@ class GresourceBackuperManager:
self._backup_file = f"{destination_file}.backup"
self._backuper = GresourceBackuper(destination_file, self._backup_file, logger_factory)
def has_trigger(self, trigger: str) -> bool:
return self._backuper.has_trigger(trigger)
def backup(self):
self._backuper.backup()
@@ -27,6 +30,10 @@ class GresourceBackuper:
self.backup_file = backup_file
self.logger_factory = logger_factory
def has_trigger(self, trigger: str) -> bool:
with open(self.destination_file, "rb") as f:
return trigger.encode() in f.read()
def get_backup(self) -> str:
if not os.path.exists(self.backup_file):
raise GresourceBackupNotFoundError(self.backup_file)