mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-11-22 21:46:04 -08:00
TESTS TESTS ADDED MORE TEST TESTED GRESOURCES TESTS TESTS I LOVE TESTS SO MUCH
- Fully covered gresource orchestrator and it helpers with tests - Use abstract command runner INSTEAD OF SUBPROCESS in gresources - Replaced some subprocesses by builtin functions
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from scripts.utils.gresource import GresourceBackupNotFoundError
|
||||
from scripts.utils.logger.logger import LoggerFactory
|
||||
@@ -23,7 +22,7 @@ class GresourceBackuperManager:
|
||||
|
||||
|
||||
class GresourceBackuper:
|
||||
def __init__(self, destination_file: str, backup_file, logger_factory: LoggerFactory):
|
||||
def __init__(self, destination_file: str, backup_file: str, logger_factory: LoggerFactory):
|
||||
self.destination_file = destination_file
|
||||
self.backup_file = backup_file
|
||||
self.logger_factory = logger_factory
|
||||
@@ -41,7 +40,6 @@ class GresourceBackuper:
|
||||
os.remove(self.backup_file)
|
||||
|
||||
shutil.copy2(self.destination_file, self.backup_file)
|
||||
# subprocess.run(["cp", "-aT", self.destination_file, self.backup_file], check=True)
|
||||
|
||||
backup_line.success("Backed up gresource files.")
|
||||
|
||||
@@ -49,4 +47,6 @@ class GresourceBackuper:
|
||||
if not os.path.exists(self.backup_file):
|
||||
raise GresourceBackupNotFoundError(self.backup_file)
|
||||
|
||||
subprocess.run(["mv", "-f", self.backup_file, self.destination_file], check=True)
|
||||
shutil.move(self.backup_file, self.destination_file)
|
||||
|
||||
self.logger_factory.create_logger().success("Restored gresource files.")
|
||||
|
||||
Reference in New Issue
Block a user