mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-11-23 05:56:05 -08:00
Completely refactored gresource to correspond SOLID principles
- Create logger interface and updated its usage by console.py
This commit is contained in:
23
scripts/utils/gresource/gresource_mover.py
Normal file
23
scripts/utils/gresource/gresource_mover.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import subprocess
|
||||
|
||||
from scripts.utils.logger.logger import LoggerFactory
|
||||
|
||||
|
||||
class GresourceMover:
|
||||
def __init__(self, source_file: str, destination_file: str, logger_factory: LoggerFactory):
|
||||
self.source_file = source_file
|
||||
self.destination_file = destination_file
|
||||
self.logger_factory = logger_factory
|
||||
|
||||
def move(self):
|
||||
move_line = self.logger_factory.create_logger()
|
||||
move_line.update("Moving gresource files...")
|
||||
|
||||
subprocess.run(["cp", "-f",
|
||||
self.source_file,
|
||||
self.destination_file],
|
||||
check=True)
|
||||
|
||||
subprocess.run(["chmod", "644", self.destination_file], check=True)
|
||||
|
||||
move_line.success("Moved gresource files.")
|
||||
Reference in New Issue
Block a user