aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/isodumper.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 24e45e9..477f7da 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -396,6 +396,7 @@ class IsoDumper:
self.success()
def do_write(self, widget):
+ self.returncode = 0
write_button = self.wTree.get_widget("write_button")
write_button.set_sensitive(False)
combo = self.wTree.get_widget("device_combobox")
@@ -428,20 +429,23 @@ class IsoDumper:
self.chooser.set_sensitive(False)
self.do_umount(target)
dialog.hide()
- # Writing step
- #Dump mode
- self.returncode=0
- b=os.path.getsize(source)
- task = self.raw_write(source, target, b)
- gobject.idle_add(task.next)
- while gtk.events_pending():
- gtk.main_iteration(True)
- task = self.check_write(target, b)
- gobject.idle_add(task.next)
- while gtk.events_pending():
- gtk.main_iteration(True)
- if self.returncode == 0:
- self.success()
+ if self.returncode != 1:
+ # Writing step
+ #Dump mode
+ self.returncode=0
+ b=os.path.getsize(source)
+ task = self.raw_write(source, target, b)
+ gobject.idle_add(task.next)
+ while gtk.events_pending():
+ gtk.main_iteration(True)
+ task = self.check_write(target, b)
+ gobject.idle_add(task.next)
+ while gtk.events_pending():
+ gtk.main_iteration(True)
+ if self.returncode == 0:
+ self.success()
+ else:
+ self.restore(widget)
else:
dialog.hide()
combo.set_sensitive(True)
@@ -458,13 +462,16 @@ class IsoDumper:
gtk.main_iteration(True)
try:
retcode = call('umount '+mount[0], shell=True)
- if retcode < 0:
+ if retcode == 32:
+ message = _('Partition %s is busy')%mount[0]
+ self.logger(message)
+ self.emergency()
+ elif retcode< 0:
self.logger(_('Error, umount ')+mount[0]+_(' was terminated by signal ')+str(retcode))
self.emergency()
- else:
- if retcode == 0:
+ elif retcode == 0:
self.logger(mount[0]+_(' successfully unmounted'))
- else:
+ else:
self.logger(_('Error, umount ')+mount[0]+_(' returned ')+str(retcode))
self.emergency()
except OSError, e: