Sun, 21 Sep 2014 15:18:24 +0200
Added some more PyQt4 compatibility code.
--- 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():