aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2021-01-20 12:35:43 +0100
committerPapoteur <papoteur@mageia.org>2021-01-20 12:35:43 +0100
commit867e58b28fe08dfe9bf7c75a936d24eb1d7fc686 (patch)
treeec27788e394859ed13785f39133d38fcbe342b42 /lib
parente9e368d9c13e54ac89639a10aae39a8da3447de2 (diff)
parentd89c6952287a01c578b7830b9d764994ad07b030 (diff)
downloadisodumper-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-xlib/isodumper.py23
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__":