fix applying for cli & gui

This commit is contained in:
leminlimez
2024-09-26 13:05:52 -04:00
parent bf36bc88b8
commit 8362fc6b4a
7 changed files with 43 additions and 12 deletions

View File

@@ -1,7 +1,9 @@
from . import backup, perform_restore
from pymobiledevice3.lockdown import LockdownClient
import os
class FileToRestore:
# TODO: Depricate this in favor of second init definition
def __init__(self, contents: str, restore_path: str, restore_name: str, owner: int = 501, group: int = 501):
self.contents = contents
self.restore_path = restore_path
@@ -9,6 +11,14 @@ class FileToRestore:
self.owner = owner
self.group = group
def __init__(self, contents: str, restore_path: str, owner: int = 501, group: int = 501):
self.contents = contents
path, file = os.path.split(restore_path)
self.restore_path = path + "/"
self.restore_name = file # TODO: Remove this and handle splitting in the restore_files function
self.owner = owner
self.group = group
# files is a list of FileToRestore objects
def restore_files(files: list, reboot: bool = False, lockdown_client: LockdownClient = None):
# create the files to be backed up