mirror of
https://github.com/leminlimez/Nugget.git
synced 2025-04-08 04:23:05 +08:00
error handling over whole apply statement
This commit is contained in:
@@ -286,6 +286,7 @@ class DeviceManager:
|
|||||||
|
|
||||||
## APPLYING OR REMOVING TWEAKS AND RESTORING
|
## APPLYING OR REMOVING TWEAKS AND RESTORING
|
||||||
def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
|
def apply_changes(self, resetting: bool = False, update_label=lambda x: None):
|
||||||
|
try:
|
||||||
# set the tweaks and apply
|
# set the tweaks and apply
|
||||||
# first open the file in read mode
|
# first open the file in read mode
|
||||||
update_label("Applying changes to files...")
|
update_label("Applying changes to files...")
|
||||||
@@ -413,7 +414,6 @@ class DeviceManager:
|
|||||||
|
|
||||||
# restore to the device
|
# restore to the device
|
||||||
update_label("Restoring to device...")
|
update_label("Restoring to device...")
|
||||||
try:
|
|
||||||
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
|
restore_files(files=files_to_restore, reboot=self.auto_reboot, lockdown_client=self.data_singleton.current_device.ld)
|
||||||
if tmp_pb_dir != None:
|
if tmp_pb_dir != None:
|
||||||
tmp_pb_dir.cleanup()
|
tmp_pb_dir.cleanup()
|
||||||
|
|||||||
Reference in New Issue
Block a user