Browse Source

Proper workaround, dont add to front of sys.path

tags/v0.9.1
falkTX 7 years ago
parent
commit
8a1940ce24
4 changed files with 8 additions and 11 deletions
  1. +1
    -1
      src/cadence.py
  2. +1
    -1
      src/catia.py
  3. +1
    -1
      src/claudia.py
  4. +5
    -8
      src/claudia_launcher.py

+ 1
- 1
src/cadence.py View File

@@ -58,7 +58,7 @@ except:
kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop"
if os.path.exists(kxstudioWorkaround): if os.path.exists(kxstudioWorkaround):
try: try:
sys.path.insert(0, kxstudioWorkaround)
sys.path.insert(1, kxstudioWorkaround)
from pyqt5 import DBusQtMainLoop from pyqt5 import DBusQtMainLoop
haveDBus = True haveDBus = True
except: except:


+ 1
- 1
src/catia.py View File

@@ -34,7 +34,7 @@ except:
kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop"
if os.path.exists(kxstudioWorkaround): if os.path.exists(kxstudioWorkaround):
try: try:
sys.path.insert(0, kxstudioWorkaround)
sys.path.insert(1, kxstudioWorkaround)
from pyqt5 import DBusQtMainLoop from pyqt5 import DBusQtMainLoop
haveDBus = True haveDBus = True
except: except:


+ 1
- 1
src/claudia.py View File

@@ -54,7 +54,7 @@ except:
kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop" kxstudioWorkaround = "/opt/kxstudio/python3/dist-packages/dbus/mainloop"
if os.path.exists(kxstudioWorkaround): if os.path.exists(kxstudioWorkaround):
try: try:
sys.path.insert(0, kxstudioWorkaround)
sys.path.insert(1, kxstudioWorkaround)
from pyqt5 import DBusQtMainLoop from pyqt5 import DBusQtMainLoop
haveDBus = True haveDBus = True
except: except:


+ 5
- 8
src/claudia_launcher.py View File

@@ -155,10 +155,11 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW):
if not os.path.exists(iconPath): if not os.path.exists(iconPath):
os.mkdir(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"))) 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_cmd = ""
tmplte_lvl = "0" tmplte_lvl = "0"


# Fix for KXStudio PyQt5 mainloop workaround
syspath = sys.path[0] 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")): if os.path.exists(os.path.join(syspath, "..", "templates")):
tmplte_dir = os.path.join(syspath, "..", "templates") tmplte_dir = os.path.join(syspath, "..", "templates")
elif os.path.exists(os.path.join(syspath, "..", "data", "templates")): elif os.path.exists(os.path.join(syspath, "..", "data", "templates")):


Loading…
Cancel
Save