aboutsummaryrefslogtreecommitdiffstats
path: root/lib/isodumper.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isodumper.py')
-rwxr-xr-xlib/isodumper.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 1bdf312..e5f7dac 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -110,10 +110,11 @@ class IsoDumper:
combo.set_sensitive(False)
self.chooser.set_sensitive(False)
source = self.chooser.get_filename()
- target = self.dev.split('(')[1].rstrip(')')
+ target = self.dev.split('(')[1].split(')')[0]
dialog = self.wTree.get_widget("confirm_dialog")
self.logger(_('Image: ')+source)
self.logger(_('Target Device: ')+self.dev)
+ self.logger(_('Target Device: ')+target)
b = os.path.getsize(source)
if b >= (eval(self.deviceSize)) :
self.logger(_('The device is too small to contain the ISO file.'))
@@ -126,14 +127,15 @@ class IsoDumper:
message.set_text(_('The device is bigger than 32 Gbytes. Are you sure you want use it?'))
resp = dialog.run()
if resp:
- self.do_umount(target)
- dialog.hide()
- task = self.raw_write(source, target)
- gobject.idle_add(task.next)
- while gtk.events_pending():
- gtk.main_iteration(True)
+ pass
else:
self.close('dummy')
+ self.do_umount(target)
+ dialog.hide()
+ task = self.raw_write(source, target)
+ gobject.idle_add(task.next)
+ while gtk.events_pending():
+ gtk.main_iteration(True)
else:
self.close('dummy')
@@ -212,7 +214,11 @@ class IsoDumper:
self.logview.scroll_to_mark(mark, 0.05, True, 0.0, 1.0)
progress.set_fraction(float(indice)/100)
indice +=1
- os.fsync(ofc)
+ try:
+ os.fsync(ofc)
+ except:
+ self.logger(_("Writing error."))
+ self.emergency()
yield True
progress.set_fraction(1.0)
self.logger(_('Image ')+source.split('/')[-1]+_(' successfully written to')+target)