Added some more PyQt4 compatibility code.

Sun, 21 Sep 2014 15:18:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Sep 2014 15:18:24 +0200
changeset 3807
91fc2089c401
parent 3806
743e085ba266
child 3808
a516f539fccf

Added some more PyQt4 compatibility code.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Globals.__init__.html file | annotate | diff | comparison | revisions
Globals/__init__.py file | annotate | diff | comparison | revisions
install.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric6.Globals.__init__.html	Sun Sep 21 14:48:08 2014 +0200
+++ b/Documentation/Source/eric6.Globals.__init__.html	Sun Sep 21 15:18:24 2014 +0200
@@ -44,7 +44,7 @@
 <td>Module function to get the name of the directory storing the config data.</td>
 </tr><tr>
 <td><a href="#getPyQt5ModulesDirectory">getPyQt5ModulesDirectory</a></td>
-<td>Function to determine the path to PyQt5's modules directory.</td>
+<td>Function to determine the path to PyQt5's (or PyQt4's) modules directory.</td>
 </tr><tr>
 <td><a href="#getPythonModulesDirectory">getPythonModulesDirectory</a></td>
 <td>Function to determine the path to Python's modules directory.</td>
@@ -114,11 +114,11 @@
 <h2>getPyQt5ModulesDirectory</h2>
 <b>getPyQt5ModulesDirectory</b>(<i></i>)
 <p>
-    Function to determine the path to PyQt5's modules directory.
+    Function to determine the path to PyQt5's (or PyQt4's) modules directory.
 </p><dl>
 <dt>Returns:</dt>
 <dd>
-path to the PyQt5 modules directory (string)
+path to the PyQt5/PyQt4 modules directory (string)
 </dd>
 </dl>
 <div align="right"><a href="#top">Up</a></div>
--- a/Globals/__init__.py	Sun Sep 21 14:48:08 2014 +0200
+++ b/Globals/__init__.py	Sun Sep 21 15:18:24 2014 +0200
@@ -161,15 +161,19 @@
     return distutils.sysconfig.get_python_lib(True)
 
 
-# TODO: modify to also work with PyQt4
 def getPyQt5ModulesDirectory():
     """
-    Function to determine the path to PyQt5's modules directory.
+    Function to determine the path to PyQt5's (or PyQt4's) modules directory.
     
-    @return path to the PyQt5 modules directory (string)
+    @return path to the PyQt5/PyQt4 modules directory (string)
     """
     import distutils.sysconfig
-    return os.path.join(distutils.sysconfig.get_python_lib(True), "PyQt5")
+    for pyqt in ["PyQt5", "PyQt4"]:
+        pyqtPath = os.path.join(distutils.sysconfig.get_python_lib(True), pyqt)
+        if os.path.exists(pyqtPath):
+            return pyqtPath
+    
+    return ""
     
 
 def getQtBinariesPath():
--- a/install.py	Sun Sep 21 14:48:08 2014 +0200
+++ b/install.py	Sun Sep 21 15:18:24 2014 +0200
@@ -1117,7 +1117,6 @@
     print()
 
 
-# TODO: PyQt4
 def compileUiFiles():
     """
     Compile the .ui files to Python sources.

eric ide

mercurial