aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2023-01-25 21:42:27 +0100
committerPapoteur <papoteur@mageia.org>2023-01-25 21:42:27 +0100
commite711651c754a7c5ef5d4b72c68006924197bd0ea (patch)
treecfa549985fad731cac9416167f4d9328d67a93c3 /lib
parentd0fde5ff3aec7aff14f39dfb89ce74d0b8d9a976 (diff)
downloadisodumper-e711651c754a7c5ef5d4b72c68006924197bd0ea.tar
isodumper-e711651c754a7c5ef5d4b72c68006924197bd0ea.tar.gz
isodumper-e711651c754a7c5ef5d4b72c68006924197bd0ea.tar.bz2
isodumper-e711651c754a7c5ef5d4b72c68006924197bd0ea.tar.xz
isodumper-e711651c754a7c5ef5d4b72c68006924197bd0ea.zip
try to fix ending without exit(), for usage in mpan
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index d153227..4cff6ce 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -211,7 +211,7 @@ class IsoDumper(basedialog.BaseDialog):
if size != 0:
label = str(name + ' (' + path.lstrip() + ') ' + self.sizeof_fmt(size))
sel = (label == selected) if selected else False
- self.devicelist.addItem(label, sel)
+ self.devicelist.addItem(label, sel)
return True
def udev_wait(self, operation):
@@ -364,14 +364,14 @@ class IsoDumper(basedialog.BaseDialog):
def do_format(self):
#code, format_type, name = self.ask_format()
if self.partition_cb.value() != "":
- self.operation = True
+ self.operation = True
format_type = list(self.format_type.keys())[list(self.format_type.values()).index(self.partition_cb.value())]
if format_type == 'persist':
self.emergency(_("Persistence partition is to use when writing a Live ISO image."))
return
target = self.dev.split('(')[1].split(')')[0]
info = Info(_("Formatting confirmation in {}".format(self.partition_cb.value())), True, self.warning)
- if self.ask_YesOrNo(info):
+ if self.ask_YesOrNo(info):
name = self.partition_label.value()
if format_type == 'fat32':
name = name.upper()[:11]
@@ -756,7 +756,8 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
info = Info(_("Error"), True, _("There is another instance of Isodumper already running."))
self.ask_OK(info)
yui.YUILoader.deleteUI()
- exit()
+ self._running = False
+ return
# TODO Read log level from command line
level = logging.DEBUG if debug else logging.ERROR
@@ -772,7 +773,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
# Operation running
self.operation = False
-
+
# Prepare interface on DBus
self.bus = SystemBus()
self.iface = self.bus.get("org.mageia.Magiback", "Isodumper")
@@ -907,7 +908,8 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
if not self.get_devices():
self.dialog.destroy()
yui.YUILoader.deleteUI()
- exit()
+ self._running = False
+ return
# Set the initial state, active, disabled
self.initial_state()
self.dialog.recalcLayout()
@@ -981,7 +983,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
self.write_cbox.setDisabled()
self.write_cbox.setChecked(False)
self.cryptcb.setChecked(False)
-
+
backup_ready = self.backup_cbox.isChecked() and (self.backup_dest != "")
write_ready = self.write_cbox.isChecked() and (self.img_name != "")
partition_ready = self.partition_cbox.isChecked() and (self.partition_cb.value() in self.format_type.values())
@@ -996,7 +998,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
else:
self.cryptcb.setDisabled()
self.cryptkey.setDisabled()
-
+
def select_backup(self):
if self.backup_cbox.isChecked():
@@ -1032,7 +1034,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
self.cryptcb.setDisabled()
self.cryptkey.setDisabled()
self.interface_active_state()
-
+
def check_encryt(self):
if self.cryptcb.isChecked():
@@ -1065,7 +1067,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
if self.partition_cbox.isChecked():
# Create a partition without writing image, will use all the device space.
self.do_format()
-
+
def ask_format(self):
atelier = yui.YUI.widgetFactory()