diff options
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__": |