diff options
author | Papoteur <papoteur@mageia.org> | 2021-01-20 12:35:43 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-01-20 12:35:43 +0100 |
commit | 867e58b28fe08dfe9bf7c75a936d24eb1d7fc686 (patch) | |
tree | ec27788e394859ed13785f39133d38fcbe342b42 /lib | |
parent | e9e368d9c13e54ac89639a10aae39a8da3447de2 (diff) | |
parent | d89c6952287a01c578b7830b9d764994ad07b030 (diff) | |
download | isodumper-867e58b28fe08dfe9bf7c75a936d24eb1d7fc686.tar isodumper-867e58b28fe08dfe9bf7c75a936d24eb1d7fc686.tar.gz isodumper-867e58b28fe08dfe9bf7c75a936d24eb1d7fc686.tar.bz2 isodumper-867e58b28fe08dfe9bf7c75a936d24eb1d7fc686.tar.xz isodumper-867e58b28fe08dfe9bf7c75a936d24eb1d7fc686.zip |
Merge branch 'master' into topic/newgui
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/isodumper.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index baae1d9..97a46f3 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -1,6 +1,6 @@ # coding:utf-8 -# !/usr/bin/python3 +# !/usr/bin/env python3 # # Copyright (c) 2007-2009 Canonical Ltd. # @@ -33,8 +33,7 @@ try: except: import version -sys.path.insert(0, '../../../build/swig/python3') -importlib.reload(sys) + ########### # imports # ########### @@ -813,18 +812,21 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.dialog.recalcLayout() self.uEventQueue = SimpleQueue() - self.glib_loop = GLib.MainLoop() - self.glib_thread = threading.Thread(target=self.glib_mainloop, args=(self.glib_loop,)) - self.glib_thread.start() + if yui.YUI.app().isTextMode(): + self.glib_loop = GLib.MainLoop() + self.glib_thread = threading.Thread(target=self.glib_mainloop, args=(self.glib_loop,)) + self.glib_thread.start() + + self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesAdded.connect(self.device_changed) + self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesRemoved.connect(self.device_changed) def glib_mainloop(self, loop): ''' thread function for glib main loop - listen to signal from udisks ''' - self.u.iface["org.freedesktop.DBus.ObjectManager"].InterfacesAdded.connect(self.device_changed) loop.run() + def device_changed(self, a, b): self.uEventQueue.put({'event': "device-changed", 'value': True}) @@ -1018,8 +1020,9 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog # Closing self.dialog.destroy() self.dialog = None - self.glib_loop.quit() - self.glib_thread.join() + if yui.YUI.app().isTextMode(): + self.glib_loop.quit() + self.glib_thread.join() if __name__ == "__main__": |