diff options
author | Papoteur <papoteur@mageia.org> | 2020-10-10 12:52:06 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2020-10-10 12:52:06 +0200 |
commit | 194a1e4f3206bcd69a0d29a831d009d0aad49536 (patch) | |
tree | 703ee51786319e17a655d4eb518b9c92f5c4d42f /lib/isodumper.py | |
parent | 80aa0733fac3bec248fc764ed44cb44d68899636 (diff) | |
download | isodumper-194a1e4f3206bcd69a0d29a831d009d0aad49536.tar isodumper-194a1e4f3206bcd69a0d29a831d009d0aad49536.tar.gz isodumper-194a1e4f3206bcd69a0d29a831d009d0aad49536.tar.bz2 isodumper-194a1e4f3206bcd69a0d29a831d009d0aad49536.tar.xz isodumper-194a1e4f3206bcd69a0d29a831d009d0aad49536.zip |
Add waiting step for table partition after new created partition
Move the do_persistence step in a thread a display progress
Diffstat (limited to 'lib/isodumper.py')
-rwxr-xr-x | lib/isodumper.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 4f77422..6e111b1 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -44,13 +44,12 @@ import time import os import re import gettext -from subprocess import call, Popen, PIPE +from subprocess import Popen, PIPE from pydbus import SystemBus -from gi.repository import GLib import psutil import manatools.args as args - + class NoUDisks2(Exception): @@ -122,7 +121,7 @@ class Info(object): class ParseCLI(args.AppArgs): def __init(self, command): super().__init__(command) - + class IsoDumper(object): def get_devices(self): @@ -346,18 +345,31 @@ class IsoDumper(object): self.logger(message) # Add persistent partition if asked if self.persistencecb.isChecked(): - self.logger(_("Adding persistent partition")) + self.progress.setLabel(_("Adding persistent partition")) + self.progress.setValue(0) if self.cryptcb.isChecked(): if self.cryptkey.value() == "": self.logger(_("No key for encrypted partition provided. Adding the partition aborted.")) else: iface.do_persistence(target,"mgalive-persist", self.cryptkey.value()) + progress = iface.progress + while not iface.done : + progress = iface.progress + self.progress.setValue(progress) + self.dialog.pollEvent() + time.sleep(.5) if iface.state: self.logger(_("Added encrypted persistent partition")) else: self.logger(iface.message) else: iface.do_persistence(target, "mgalive-persist", "") + progress = iface.progress + while not iface.done : + progress = iface.progress + self.progress.setValue(progress) + self.dialog.pollEvent() + time.sleep(.5) self.logger(_("Added persistent partition")) # Unmount if partitions are automatically mounted and then eject success, message = iface.do_unmount(target) @@ -365,7 +377,7 @@ class IsoDumper(object): self.u.eject(target) self.success() else: - emergency(message) + self.emergency(message) self.restore() else: self.emergency(message) |