mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-17 16:57:56 -07:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user