コード例 #1
0
ファイル: hookutils_test.py プロジェクト: TeamSWAP/swap
 def setUp(self, package=HOOKUTILS_TEST_FILES):
     self.basepath = join(os.getcwd(), HOOKUTILS_TEST_FILES)
     # Fun Python behavior: __import__('mod.submod') returns mod,
     # where as __import__('mod.submod', fromlist = [a non-empty list])
     # returns mod.submod. See the docs on `__import__
     # <http://docs.python.org/library/functions.html#__import__>`_.
     self.data_list = collect_data_files(__import__(package, fromlist=['']))
     self.split_data_list()
コード例 #2
0
 def setUp(self, package = HOOKUTILS_TEST_FILES):
     self.parentpath = join(os.getcwd(), HOOKUTILS_TEST_FILES)
     # Fun Python behavior: __import__('mod.submod') returns mod,
     # where as __import__('mod.submod', fromlist = [a non-empty list])
     # returns mod.submod. See the docs on `__import__
     # <http://docs.python.org/library/functions.html#__import__>`_.
     self.data_list = collect_data_files(__import__(package,
                                                   fromlist = ['']))
     self.split_data_list()
コード例 #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 collect_data_files

# On Linux pytz installed from distribution repository uses zoneinfo
# fron /usr/share/zoneinfo/ and no data files might be collected.
datas = collect_data_files('pytz')
コード例 #4
0
ファイル: hookutils_test.py プロジェクト: TeamSWAP/swap
 def test_4(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES + '.subpkg')
     self.split_data_list()
     self.assert_data_list_equal(self.subpkg_subfiles)
コード例 #5
0
ファイル: hookutils_test.py プロジェクト: TeamSWAP/swap
 def test_0(self):
     # os is a module, not a package.
     with self.assertRaises(AttributeError):
         collect_data_files(__import__('os'))
コード例 #6
0
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files('ionize')
コード例 #7
0
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('jsonschema')
コード例 #8
0
ファイル: hook-mcedit2.py プロジェクト: 101baja202/mcedit2
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function#, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)

# Remove cython and coverage byproducts
def ext_filter(source):
    base = os.path.basename(source)
    if base == '.coverage':
        return False
    name, ext = os.path.splitext(base)
    return ext not in ('.c', '.html')

mceditlib_datas = collect_data_files('mceditlib')
mceditlib_datas = [(source, dest)
                   for source, dest in mceditlib_datas
                   if ext_filter(source)]

mcedit2_datas = collect_data_files('mcedit2')
mcedit2_datas = [(source, dest)
                 for source, dest in mcedit2_datas
                 if ext_filter(source)]

datas = mceditlib_datas + mcedit2_datas

コード例 #9
0
ファイル: hook-pytz.py プロジェクト: Alwnikrotikz/bionetgen
#-----------------------------------------------------------------------------
# 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 collect_data_files


# On Linux pytz installed from distribution repository uses zoneinfo
# fron /usr/share/zoneinfo/ and no data files might be collected.
datas = collect_data_files('pytz')
コード例 #10
0
ファイル: hook-django.py プロジェクト: TeamSWAP/swap
    logger.info('Django root directory %s', root_dir)
    hiddenimports = django_dottedstring_imports(root_dir)
    # Include main django modules - settings.py, urls.py, wsgi.py.
    # Without them the django server won't run.
    package_name = os.path.basename(root_dir)
    hiddenimports += [
        # TODO Consider including 'mysite.settings.py' in source code as a data files.
        #      Since users might need to edit this file.
        package_name + '.settings',
        package_name + '.urls',
        package_name + '.wsgi',
    ]
    # Include some hidden modules that are not imported directly in django.
    hiddenimports += [
        'django.template.defaultfilters',
        'django.template.defaulttags',
        'django.template.loader_tags',
    ]
    # Other hidden imports to get Django example startproject working.
    hiddenimports += [
        'django.contrib.messages.storage.fallback',
    ]
    # Include django data files - localizations, etc.
    datas = collect_data_files('django')

    # Include data files from your Django project found in your django root package.
    datas += collect_data_files(package_name)

else:
    logger.warn('No django root directory could be found!')
コード例 #11
0
# -*- coding: utf-8 -*-

from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('mongrey', subdir='translations')
datas += collect_data_files('mongrey', subdir='web/static')
datas += collect_data_files('mongrey', subdir='web/templates')
datas += collect_data_files('mongrey', subdir='ext')
コード例 #12
0
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files(
    "S:\\Development\\Python\\jarvis_voiceai\\venv\\Lib\\site-packages\\speech_recognition"
)
コード例 #13
0
# -----------------------------------------------------------------------------
# Copyright (c) 2014, 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 collect_data_files  # pragma: no cover

datas = collect_data_files('certifi')  # pragma: no cover
コード例 #14
0
#        pkg_base, pkg_dir = get_package_paths(package)
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 646, in get_package_paths
#        assert is_package, 'Package %s does not have __path__ attribute' % package
#    AssertionError: Package PyKDE4 does not have __path__ attribute
#
# Therefeore, catch this exception and ignore it. When this happends, a message
# is still generated::
#
#    2141 INFO: Processing hook hook-PyQt4.QtCore
#    Traceback (most recent call last):
#      File "<string>", line 1, in <module>
#    ImportError: No module named PyKDE4
#    2862 INFO: Processing hook hook-PyQt4.uic
#
# Note that the warning comes BEFORE hook-PyQt4.uic is listed, not after;
# however, the raised assertion caught by the try/except block below produces
# it, not any code in hook-PyQt4.QtCore.
if is_linux:
    try:
        hiddenimports = collect_submodules('PyKDE4') + [
            'PyQt4.QtSvg', 'PyQt4.QtXml'
        ]
    except AssertionError:
        pass
# Need to include modules in PyQt4.uic.widget-plugins, so they can be
# dynamically loaded by uic. They should both be included as separate
# (data-like) files, so they can be found by os.listdir and friends. However,
# this directory isn't a package, refer to it using the package (PyQt4.uic)
# followed by the subdirectory name (widget-plugins/).
datas = collect_data_files('PyQt4.uic', True, 'widget-plugins')
コード例 #15
0
ファイル: hook-IPython.py プロジェクト: dvitonis/pyinstaller
#-----------------------------------------------------------------------------
# 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 (collect_data_files, collect_submodules)


# IPython (tested with 0.13) requires the following files:
#   ./site-packages/IPython/config/profile/README_STARTUP
datas = collect_data_files('IPython')
hiddenimports = collect_submodules('IPython')
コード例 #16
0
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('certifi')
コード例 #17
0
 def test_0(self):
     # os is a module, not a package.
     with self.assertRaises(AttributeError):
         collect_data_files(__import__('os'))
コード例 #18
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 collect_submodules, collect_data_files

hiddenimports = (
    collect_submodules("docutils.languages")
    + collect_submodules("docutils.writers")
    + collect_submodules("docutils.parsers.rst.languages")
    + collect_submodules("docutils.parsers.rst.directives")
)
datas = collect_data_files("docutils")
コード例 #19
0
 def test_3(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES)
     self.split_data_list()
     self.assert_data_list_equal(self.all_subfiles)
コード例 #20
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 collect_data_files

datas = collect_data_files('selenium')
コード例 #21
0
 def test_4(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES +
                                         '.subpkg')
     self.split_data_list()
     self.assert_data_list_equal(self.subpkg_subfiles)
コード例 #22
0
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('cloudify_cli')
コード例 #23
0
ファイル: hook-names.py プロジェクト: mliao2/pyinstaller
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

# Module PyPI Homepage: https://pypi.python.org/pypi/names/0.3.0


from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('names')
コード例 #24
0
Hook for PyOpenGL 3.x versions from 3.0.0b6 up. Previous versions have a
plugin system based on pkg_resources which is problematic to handle correctly
under pyinstaller; 2.x versions used to run fine without hooks, so this one
shouldn't hurt.
"""

from PyInstaller.compat import is_win, is_darwin
from PyInstaller.hooks.hookutils import collect_data_files
from PyInstaller.hooks.hookutils import opengl_arrays_modules

# PlatformPlugin performs a conditional import based on os.name and
# sys.platform. PyInstaller misses this so let's add it ourselves...
if is_win:
    hiddenimports = ['OpenGL.platform.win32']
elif is_darwin:
    hiddenimports = ['OpenGL.platform.darwin']
# Use glx for other platforms (Linux, ...)
else:
    hiddenimports = ['OpenGL.platform.glx']

# Arrays modules are needed too.
hiddenimports += opengl_arrays_modules()

# PyOpenGL 3.x uses ctypes to load DLL libraries. PyOpenGL windows installer
# adds necessary dll files to
#   DLL_DIRECTORY = os.path.join( os.path.dirname( OpenGL.__file__ ), 'DLLS')
# PyInstaller is not able to find these dlls. Just include them all as data
# files.
if is_win:
    datas = collect_data_files('OpenGL')
コード例 #25
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 collect_data_files

hiddenimports = ["babel.dates"]
datas = collect_data_files('babel')
コード例 #26
0
ファイル: hookutils_test.py プロジェクト: TeamSWAP/swap
 def test_3(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES)
     self.split_data_list()
     self.assert_data_list_equal(self.all_subfiles)
コード例 #27
0
# -----------------------------------------------------------------------------
# Copyright (c) 2014, 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.
# -----------------------------------------------------------------------------

# this is needed to bundle cacert.pem that comes with requests module
from PyInstaller.hooks.hookutils import collect_data_files  # pragma: no cover

datas = collect_data_files('requests')  # pragma: no cover
コード例 #28
0
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files('mpl_toolkits.basemap')
コード例 #29
0
ファイル: hook-idlelib.py プロジェクト: mliao2/pyinstaller
#-----------------------------------------------------------------------------
# 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 collect_data_files

datas = collect_data_files('idlelib')
コード例 #30
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 collect_data_files

datas = collect_data_files('countrycode')
コード例 #31
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.
#-----------------------------------------------------------------------------

import os.path
from PyInstaller.hooks.hookutils import (collect_data_files,
                                         collect_submodules)
from distutils.sysconfig import get_python_inc

# IPython (tested with 0.13) requires the following files:
#   ./site-packages/IPython/config/profile/README_STARTUP
datas = collect_data_files('scipy.weave')
datas += collect_data_files('numpy.core')
datas += [(get_python_inc(), 'include')]

hiddenimports = collect_submodules('scipy.weave')
コード例 #32
0
from PyInstaller.hooks.hookutils import get_package_paths
from PyInstaller.hooks.hookutils import collect_data_files

package_name = "cloudify_openstack"
package_path = get_package_paths(package_name)[1]

datas = [(package_path + "/*.py", package_name)] + collect_data_files(package_name)
コード例 #33
0
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files("requests")
コード例 #34
0
ファイル: hook-docutils.py プロジェクト: mliao2/pyinstaller
#-----------------------------------------------------------------------------
# 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 collect_submodules, collect_data_files

hiddenimports = (collect_submodules('docutils.languages') +
                 collect_submodules('docutils.writers') +
                 collect_submodules('docutils.parsers.rst.languages') +
                 collect_submodules('docutils.parsers.rst.directives'))
datas = collect_data_files('docutils')
コード例 #35
0
ファイル: hook-mcedit2.py プロジェクト: metehanboy/mcedit2
"""
    hook-mcedit2.py
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function  #, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)

datas = collect_data_files('mceditlib') + collect_data_files('mcedit2')
コード例 #36
0
ファイル: hook-OpenGL.py プロジェクト: xujianjlu/Flame
# shouldn't hurt.


from PyInstaller.compat import is_win, is_darwin
from PyInstaller.hooks.hookutils import collect_data_files
from PyInstaller.hooks.hookutils import opengl_arrays_modules


# PlatformPlugin performs a conditional import based on os.name and
# sys.platform. PyInstaller misses this so let's add it ourselves...
if is_win:
    hiddenimports = ['OpenGL.platform.win32']
elif is_darwin:
    hiddenimports = ['OpenGL.platform.darwin']
# Use glx for other platforms (Linux, ...)
else:
    hiddenimports = ['OpenGL.platform.glx']


# Arrays modules are needed too.
hiddenimports += opengl_arrays_modules()


# PyOpenGL 3.x uses ctypes to load DLL libraries. PyOpenGL windows installer
# adds necessary dll files to 
#   DLL_DIRECTORY = os.path.join( os.path.dirname( OpenGL.__file__ ), 'DLLS')
# PyInstaller is not able to find these dlls. Just include them all as data
# files.
if is_win:
    datas = collect_data_files('OpenGL')
コード例 #37
0
# -*- coding: utf-8 -*-

from PyInstaller.hooks.hookutils import collect_submodules, collect_data_files

hiddenimports = collect_submodules('flask.ext')
hiddenimports += collect_submodules('flask_security')

datas = collect_data_files('flask_security', subdir='templates')

コード例 #38
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 collect_data_files
datas = collect_data_files('idlelib')
コード例 #39
0
    logger.info('Django root directory %s', root_dir)
    hiddenimports = django_dottedstring_imports(root_dir)
    # Include main django modules - settings.py, urls.py, wsgi.py.
    # Without them the django server won't run.
    package_name = os.path.basename(root_dir)
    hiddenimports += [
            # TODO Consider including 'mysite.settings.py' in source code as a data files.
            #      Since users might need to edit this file.
            package_name + '.settings',
            package_name + '.urls',
            package_name + '.wsgi',
    ]
    # Include some hidden modules that are not imported directly in django.
    hiddenimports += [
            'django.template.defaultfilters',
            'django.template.defaulttags',
            'django.template.loader_tags',
    ]
    # Other hidden imports to get Django example startproject working.
    hiddenimports += [
            'django.contrib.messages.storage.fallback',
    ]
    # Include django data files - localizations, etc.
    datas = collect_data_files('django')

    # Include data files from your Django project found in your django root package.
    datas += collect_data_files(package_name)

else:
    logger.warn('No django root directory could be found!')
コード例 #40
0
#-----------------------------------------------------------------------------
# Copyright (c) 2015, 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.
#-----------------------------------------------------------------------------

# Hook for weasyprint: https://pypi.python.org/pypi/WeasyPrint
# Tested on version weasyprint 0.24 using Windows 7 and python 2.7

from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('weasyprint')
コード例 #41
0
    hook-mcedit2.py
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function  #, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)


# Remove cython and coverage byproducts
def ext_filter(source):
    base = os.path.basename(source)
    if base == '.coverage':
        return False
    name, ext = os.path.splitext(base)
    return ext not in ('.c', '.html')


mceditlib_datas = collect_data_files('mceditlib')
mceditlib_datas = [(source, dest) for source, dest in mceditlib_datas
                   if ext_filter(source)]

mcedit2_datas = collect_data_files('mcedit2')
mcedit2_datas = [(source, dest) for source, dest in mcedit2_datas
                 if ext_filter(source)]

datas = mceditlib_datas + mcedit2_datas
コード例 #42
0
#        hiddenimports += collect_submodules('PyKDE4') + ['PyQt4.QtSvg', 'PyQt4.QtXml']
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 679, in collect_submodules
#        pkg_base, pkg_dir = get_package_paths(package)
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 646, in get_package_paths
#        assert is_package, 'Package %s does not have __path__ attribute' % package
#    AssertionError: Package PyKDE4 does not have __path__ attribute
#
# Therefeore, catch this exception and ignore it. When this happends, a message
# is still generated::
#
#    2141 INFO: Processing hook hook-PyQt4.QtCore
#    Traceback (most recent call last):
#      File "<string>", line 1, in <module>
#    ImportError: No module named PyKDE4
#    2862 INFO: Processing hook hook-PyQt4.uic
#
# Note that the warning comes BEFORE hook-PyQt4.uic is listed, not after;
# however, the raised assertion caught by the try/except block below produces
# it, not any code in hook-PyQt4.QtCore.
if is_linux:
    try:
        hiddenimports = collect_submodules('PyKDE4') + ['PyQt4.QtSvg', 'PyQt4.QtXml']
    except AssertionError:
        pass
# Need to include modules in PyQt4.uic.widget-plugins, so they can be
# dynamically loaded by uic. They should both be included as separate
# (data-like) files, so they can be found by os.listdir and friends. However,
# this directory isn't a package, refer to it using the package (PyQt4.uic)
# followed by the subdirectory name (widget-plugins/).
datas = collect_data_files('PyQt4.uic', True, 'widget-plugins')
コード例 #43
0
from PyInstaller.hooks.hookutils import collect_data_files

# Get the cacert.pem
datas = collect_data_files('appscript') 
コード例 #44
0
ファイル: hook-sphinx.py プロジェクト: mliao2/pyinstaller
#-----------------------------------------------------------------------------
# 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 collect_submodules, collect_data_files

hiddenimports = collect_submodules('sphinx.ext')
datas = collect_data_files('sphinx')
コード例 #45
0
from PyInstaller.hooks.hookutils import collect_data_files, collect_submodules
datas = collect_data_files('natcap.rios') + collect_data_files(
    'natcap.rios.rui')
hiddenimports = collect_submodules('natcap.rios') + collect_submodules(
    'natcap.rios.rui') + collect_submodules('multiprocessing')
コード例 #46
0
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('requests')
コード例 #47
0
from PyInstaller.hooks.hookutils import get_package_paths
from PyInstaller.hooks.hookutils import collect_data_files

package_name = 'cloudify_openstack'
package_path = get_package_paths(package_name)[1]

datas = [(package_path + '/*.py', package_name)
         ] + collect_data_files(package_name)