diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt index 9d4fd75..1a79f2c 100644 --- a/doc/CHANGES.txt +++ b/doc/CHANGES.txt @@ -36,6 +36,7 @@ Changes since PyInstaller 1.3 + Add import hooks for email in Python 2.5 (though it does not support the old-style Python 2.4 syntax with Python 2.5). + Add import hook for gadfly. + + Add import hook for PyQWt5. + Improve import hooks for PyGTK (thanks to Marco Bonifazi and foxx). + Add fix for the very annoying "MSVCRT71 could not be extracted" bug, which was caused by the DLL being packaged twice (thanks to Idris diff --git a/hooks/hook-PyQt4.Qwt5.py b/hooks/hook-PyQt4.Qwt5.py new file mode 100644 index 0000000..936bc31 --- /dev/null +++ b/hooks/hook-PyQt4.Qwt5.py @@ -0,0 +1,10 @@ +from hooks import hookutils + +hiddenimports = ["PyQt4.QtCore", "PyQt4.QtGui", "PyQt4.QtSvg"] + +if hookutils.qwt_numpy_support(): + hiddenimports.append("numpy") +if hookutils.qwt_numeric_support(): + hiddenimports.append("Numeric") +if hookutils.qwt_numarray_support(): + hiddenimports.append("numarray") diff --git a/hooks/hookutils.py b/hooks/hookutils.py index 7603ce0..76e5d35 100644 --- a/hooks/hookutils.py +++ b/hooks/hookutils.py @@ -25,4 +25,9 @@ def qt4_plugins_dir(): return exec_statement("from PyQt4.QtCore import QLibraryInfo; print QLibraryInfo.location(QLibraryInfo.PluginsPath)") def mpl_data_dir(): return exec_statement("import matplotlib; print matplotlib._get_data_path()") - +def qwt_numpy_support(): + return eval(exec_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumpy')")) +def qwt_numeric_support(): + return eval(exec_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumeric')")) +def qwt_numarray_support(): + return eval(exec_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumarray')"))