diff options
author | Papoteur <papoteur@mageia.org> | 2019-09-07 15:24:45 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-09-07 15:24:45 +0200 |
commit | 0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3 (patch) | |
tree | 87662fa694f105852b4fd35fa79adb08eac6d713 /lib | |
parent | ba406b0012d167712efce000c2b5ea383a5a3987 (diff) | |
download | isodumper-0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3.tar isodumper-0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3.tar.gz isodumper-0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3.tar.bz2 isodumper-0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3.tar.xz isodumper-0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3.zip |
Add eject order after the writing operation (mga#25347)
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 1cf29cb..9c34e15 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -58,11 +58,12 @@ class UDisks2(object): BLOCK = 'org.freedesktop.UDisks2.Block' DRIVE = 'org.freedesktop.UDisks2.Drive' + SERVICE = 'org.freedesktop.UDisks2' def __init__(self): self.bus = SystemBus() try: - self.iface = self.bus.get('org.freedesktop.UDisks2') + self.iface = self.bus.get(self.SERVICE) except : raise NoUDisks2() @@ -101,6 +102,14 @@ class UDisks2(object): list.append(item) return list + def eject(self, device): + ''' device is expected like /dev/sda''' + block = os.path.basename(device) + iface = self.bus.get(self.SERVICE,'/org/freedesktop/UDisks2/block_devices/' + block) + drive = iface.Get(self.BLOCK,"Drive") + i_drive = self.bus.get(self.SERVICE, drive) + i_drive.Eject({}) + class Info(object): def __init__(self,title,richtext,text): self.title=title @@ -316,7 +325,7 @@ class IsoDumper(object): self.logger(_('Bytes written: ')+str(b)) self.progress.setLabel(_('Checking ')+target.split('/')[-1]) self.progress.setValue(0) - self.dialog.pollEvent() + self.dialog.pollEvent() # Checking iface.check_write(target, source) progress = iface.progress @@ -335,7 +344,9 @@ class IsoDumper(object): self.logger(_("Adding persistent partition")) iface.do_persistence(target,"mgalive-persist") self.logger(_("Added persistent partition")) - self.success() + #Eject + self.u.eject(target) + self.success() else: self.emergency(message) else: |