Exemplo n.º 1
0
def qt_plugin_binaries(plug_type):
    global _qt_dir

    if _qt_dir is None:
        dirs = eval_statement(
            'from PySide.QtCore import QCoreApplication;' +
            'app = QCoreApplication([]);' +
            'print map(unicode, app.libraryPaths())'
        )

        if not dirs:
            logger.error('Can\'t find PySide plugin directories.')
            return

        for path in dirs:
            if os.path.isdir(path):
                _qt_dir = str(path)
                break

        if _qt_dir is None:
            logger.error('PySide didn\'t provide any existing plugin directory.')
            return
        else:
            # Make sure PyInstaller finds all dlls.
            sys.path.append(os.path.dirname(_qt_dir))

    dlls = misc.dlls_in_dir(os.path.join(_qt_dir, plug_type))
    if is_win:
        dlls = [p for p in dlls if not p.endswith('d4.dll')]

    for path in dlls:
        yield (os.path.join('plugins', plug_type, os.path.basename(path)), path, 'BINARY')
Exemplo n.º 2
0
def qt_plugin_binaries(plug_type):
    global _qt_dir

    if _qt_dir is None:
        dirs = eval_statement('from PySide.QtCore import QCoreApplication;' +
                              'app = QCoreApplication([]);' +
                              'print map(unicode, app.libraryPaths())')

        if not dirs:
            logger.error('Can\'t find PySide plugin directories.')
            return

        for path in dirs:
            if os.path.isdir(path):
                _qt_dir = str(path)
                break

        if _qt_dir is None:
            logger.error(
                'PySide didn\'t provide any existing plugin directory.')
            return
        else:
            # Make sure PyInstaller finds all dlls.
            sys.path.append(os.path.dirname(_qt_dir))

    dlls = misc.dlls_in_dir(os.path.join(_qt_dir, plug_type))
    if is_win:
        dlls = [p for p in dlls if not p.endswith('d4.dll')]

    for path in dlls:
        yield (os.path.join('plugins', plug_type,
                            os.path.basename(path)), path, 'BINARY')
Exemplo n.º 3
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

from PyInstaller.hooks.hookutils import eval_statement

hiddenimports = ["PyQt4.QtCore", "PyQt4.QtGui", "PyQt4.QtSvg"]

if eval_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumpy')"):
    hiddenimports.append("numpy")
if eval_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumeric')"):
    hiddenimports.append("Numeric")
if eval_statement("from PyQt4 import Qwt5; print hasattr(Qwt5, 'toNumarray')"):
    hiddenimports.append("numarray")
Exemplo n.º 4
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------


from PyInstaller.hooks.hookutils import eval_statement

hiddenimports = ["PyQt5.QtCore",
                 "PyQt5.QtWidgets",
                 "PyQt5.QtGui",
                 "PyQt5.QtSvg"]

if eval_statement("from PyQt5 import Qwt5; print(hasattr(Qwt5, 'toNumpy'))"):
    hiddenimports.append("numpy")
if eval_statement("from PyQt5 import Qwt5; print(hasattr(Qwt5, 'toNumeric'))"):
    hiddenimports.append("Numeric")
if eval_statement("from PyQt5 import Qwt5; print(hasattr(Qwt5, 'toNumarray'))"):
    hiddenimports.append("numarray")