def hook(mod): """ Include the cffi extensions as binaries in a subfolder named like the package. The cffi verifier expects to find them inside the package directory for the main module. We cannot use hiddenimports because that would add the modules outside the package. """ cryptography_dir = os.path.dirname(get_module_file_attribute('cryptography')) for ext in PY_EXTENSION_SUFFIXES: ffimods = glob.glob(os.path.join(cryptography_dir, '*_cffi_*%s*' % ext)) for f in ffimods: name = os.path.join('cryptography', os.path.basename(f)) # TODO fix this hook to use attribute 'binaries'. mod.pyinstaller_binaries.append((name, f, 'BINARY')) return mod
def hook(mod): """ Include the cffi extensions as binaries in a subfolder named like the package. The cffi verifier expects to find them inside the package directory for the main module. We cannot use hiddenimports because that would add the modules outside the package. """ crypto_dir = os.path.dirname(get_module_file_attribute('cryptography')) for ext in PY_EXTENSION_SUFFIXES: ffimods = glob.glob(os.path.join(crypto_dir, '*_cffi_*%s*' % ext)) for f in ffimods: name = os.path.join('cryptography', os.path.basename(f)) # TODO fix this hook to use attribute 'binaries'. mod.pyinstaller_binaries.append((name, f, 'BINARY')) return mod
def hook(mod): pth = get_module_file_attribute('pythoncom') name = os.path.basename(pth) mod.binaries.extend([(name, pth, 'BINARY')]) return mod
# # Copyright (C) 2012, Martin Zibricky # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # pywin32 module supports frozen mode. In frozen mode it is looking # in sys.path for file pywintypesXX.dll. Include the pywintypesXX.dll # as a data file. The path to this dll is contained in __file__ # attribute. from PyInstaller.hooks.hookutils import get_module_file_attribute datas = [(get_module_file_attribute('pywintypes'), '.')]
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- """ pywin32 module supports frozen mode. In frozen mode it is looking in sys.path for file pywintypesXX.dll. Include the pywintypesXX.dll as a data file. The path to this dll is contained in __file__ attribute. """ import os.path from PyInstaller.hooks.hookutils import get_module_file_attribute _pth = get_module_file_attribute('pywintypes') binaries = [(os.path.basename(_pth), _pth)]
# # Copyright (C) 2012, Martin Zibricky # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # pywin32 module supports frozen mode. In frozen mode it is looking # in sys.path for file pythoncomXX.dll. Include the pythoncomXX.dll # as a data file. The path to this dll is contained in __file__ # attribute. from PyInstaller.hooks.hookutils import get_module_file_attribute datas = [(get_module_file_attribute('pythoncom'), '.')]
# # Copyright (C) 2012, Martin Zibricky # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # pywin32 module supports frozen mode. In frozen mode it is looking # in sys.path for file pywintypesXX.dll. Include the pywintypesXX.dll # as a data file. The path to this dll is contained in __file__ # attribute. from PyInstaller.hooks.hookutils import get_module_file_attribute #datas = [(get_module_file_attribute('pywintypes'), '.')] import sys datas = [(get_module_file_attribute('pywintypes%d%d' % sys.version_info[:2]), '.')]
# # 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. #----------------------------------------------------------------------------- """ pywin32 module supports frozen mode. In frozen mode it is looking in sys.path for file pythoncomXX.dll. Include the pythoncomXX.dll as a data file. The path to this dll is contained in __file__ attribute. """ import os.path from PyInstaller.hooks.hookutils import get_module_file_attribute _pth = get_module_file_attribute('pythoncom') # Binaries that should be included with the module 'pythoncom'. # List mod.pyinstaller_binaries gets extended. binaries = [ ( # Relative path in the ./dist/app_name/ directory. os.path.basename(_pth), # Absolute path on hard disk. _pth, ) ]