mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
fix applying for cli & gui
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user