From 8a1940ce247893a40a6dd67466c516ec37e22873 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 27 Apr 2018 07:58:56 +0300 Subject: [PATCH] Proper workaround, dont add to front of sys.path --- src/cadence.py | 2 +- src/catia.py | 2 +- src/claudia.py | 2 +- src/claudia_launcher.py | 13 +++++-------- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/cadence.py b/src/cadence.py index 1893c38..88816d9 100755 --- a/src/cadence.py +++ b/src/cadence.py @@ -58,7 +58,7 @@ except: kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" if os.path.exists(kxstudioWorkaround): try: - sys.path.insert(0, kxstudioWorkaround) + sys.path.insert(1, kxstudioWorkaround) from pyqt5 import DBusQtMainLoop haveDBus = True except: diff --git a/src/catia.py b/src/catia.py index 098a843..8101d60 100755 --- a/src/catia.py +++ b/src/catia.py @@ -34,7 +34,7 @@ except: kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" if os.path.exists(kxstudioWorkaround): try: - sys.path.insert(0, kxstudioWorkaround) + sys.path.insert(1, kxstudioWorkaround) from pyqt5 import DBusQtMainLoop haveDBus = True except: diff --git a/src/claudia.py b/src/claudia.py index fd9c36e..c69bfc4 100755 --- a/src/claudia.py +++ b/src/claudia.py @@ -54,7 +54,7 @@ except: kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" if os.path.exists(kxstudioWorkaround): try: - sys.path.insert(0, kxstudioWorkaround) + sys.path.insert(1, kxstudioWorkaround) from pyqt5 import DBusQtMainLoop haveDBus = True except: diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index ccf928c..5fdde47 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -155,10 +155,11 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): if not os.path.exists(iconPath): os.mkdir(iconPath) - if os.path.exists(os.path.join(sys.path[0], "..", "icons")): - os.system("cp -r '%s' '%s'" % (os.path.join(sys.path[0], "..", "icons", "claudia-hicolor"), iconPath)) - elif os.path.exists(os.path.join(sys.path[0], "..", "data", "icons")): - os.system("cp -r '%s' '%s'" % (os.path.join(sys.path[0], "..", "data", "icons", "claudia-hicolor"), iconPath)) + syspath = sys.path[0] + if os.path.exists(os.path.join(syspath, "..", "icons")): + os.system("cp -r '%s' '%s'" % (os.path.join(syspath, "..", "icons", "claudia-hicolor"), iconPath)) + elif os.path.exists(os.path.join(syspath, "..", "data", "icons")): + os.system("cp -r '%s' '%s'" % (os.path.join(syspath, "..", "data", "icons", "claudia-hicolor"), iconPath)) os.system("sed -i 's/X-CURRENT-THEME-X/%s/' '%s'" % (self.m_lastThemeName, os.path.join(iconPath, "claudia-hicolor", "index.theme"))) @@ -275,11 +276,7 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): tmplte_cmd = "" tmplte_lvl = "0" - # Fix for KXStudio PyQt5 mainloop workaround syspath = sys.path[0] - if syspath == "/opt/kxstudio/python3/dist-packages/dbus/mainloop" and len(sys.path) >= 2: - syspath = sys.path[1] - if os.path.exists(os.path.join(syspath, "..", "templates")): tmplte_dir = os.path.join(syspath, "..", "templates") elif os.path.exists(os.path.join(syspath, "..", "data", "templates")):