mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-11-24 06:26:03 -08:00
Completely refactored gresource to correspond SOLID principles
- Create logger interface and updated its usage by console.py
This commit is contained in:
21
scripts/utils/gresource/__init__.py
Normal file
21
scripts/utils/gresource/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
class GresourceBackupNotFoundError(FileNotFoundError):
|
||||
def __init__(self, location: str = None):
|
||||
if location:
|
||||
super().__init__(f"Gresource backup file not found: {location}")
|
||||
else:
|
||||
super().__init__("Gresource backup file not found.")
|
||||
|
||||
|
||||
class MissingDependencyError(Exception):
|
||||
def __init__(self, dependency: str):
|
||||
super().__init__(f"Missing required dependency: {dependency}")
|
||||
self.dependency = dependency
|
||||
|
||||
|
||||
def raise_gresource_error(tool: str, e: Exception):
|
||||
print(f"Error: '{tool}' command not found.")
|
||||
print("Please install the glib2-devel package:")
|
||||
print(" - For Fedora/RHEL: sudo dnf install glib2-devel")
|
||||
print(" - For Ubuntu/Debian: sudo apt install libglib2.0-dev")
|
||||
print(" - For Arch: sudo pacman -S glib2-devel")
|
||||
raise MissingDependencyError("glib2-devel") from e
|
||||
Reference in New Issue
Block a user