diff options
author | Papoteur <papoteur@mageia.org> | 2021-05-29 22:52:36 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-05-30 19:03:22 +0200 |
commit | 9f59898cc4243bea0d8a746fe386f31143a21515 (patch) | |
tree | 942624edab626f9bf8e6fee78b2ed2367f5dfdc2 /lib | |
parent | 88565bc8fa6e05a6baa3859a2e8b369109e519d7 (diff) | |
download | isodumper-9f59898cc4243bea0d8a746fe386f31143a21515.tar isodumper-9f59898cc4243bea0d8a746fe386f31143a21515.tar.gz isodumper-9f59898cc4243bea0d8a746fe386f31143a21515.tar.bz2 isodumper-9f59898cc4243bea0d8a746fe386f31143a21515.tar.xz isodumper-9f59898cc4243bea0d8a746fe386f31143a21515.zip |
Avoid to launch writing if backup failed
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index b67b436..2bc3e33 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -458,7 +458,7 @@ class IsoDumper(basedialog.BaseDialog): info = Info(_("Backup confirmation"), True, _("Do you want to overwrite the file?")) if not (self.ask_YesOrNo(info)): self.returncode = 1 - return True + return False st = os.statvfs(os.path.dirname(dest)) free = st.f_bavail * st.f_frsize if free < self.deviceSize: @@ -468,6 +468,7 @@ class IsoDumper(basedialog.BaseDialog): logging.warning(message) self.emergency(message) self.initial_state() + return False else: self.operation = True self.returncode = 0 @@ -498,6 +499,8 @@ class IsoDumper(basedialog.BaseDialog): else: self.emergency(message) self.initial_state() + return False + return True def do_write(self): self.wip_unsensitive() @@ -1041,11 +1044,15 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog if self.backup_cbox.isChecked(): # check that a name is set if self.backup_is_selected: - self.backup_go() - self.backup_is_selected = False + if self.backup_go(): + self.backup_is_selected = False + else: + # something went wrong, we stop + return else: info = Info(_("Error"), True, _("No image for backup is selected.")) self.ask_OK(info) + return if self.write_cbox.isChecked(): if self.image_is_selected: self.do_write() |