def _set_search_path_if_we_can(self, path): """ Convenience function used in get() """ # Get command or return if not dllutils.get_command_to_set_search_path(): return # Get relative path dependerDir = os.path.dirname(path) relDir = os.path.relpath(self._dstDir, dependerDir) # Set it! try: dllutils.set_search_path(path, relDir) except Exception as err: print('Could not set search path for %s' % path)
use this standard. For more info, contact either of us. """.lstrip() with open(os.path.join(distDir, '_settings', 'README.txt'), 'wb') as file: file.write(SETTINGS_TEXT.encode('utf-8')) ## Post processing # Set search path of dynamic libraries from pyzolib import dllutils if sys.platform.startswith('linux'): # Exe dllutils.set_search_path(os.path.join(distDir, 'pyzo'), '', 'lib') # Libs os.mkdir(os.path.join(distDir, 'lib')) for entry in os.listdir(distDir): filename = os.path.join(distDir, entry) if not os.path.isfile(filename): continue if not (entry.endswith('.so') or '.so.' in entry): continue # rpaths = '', 'lib' if entry.startswith('lib') and not 'python' in entry: filename = os.path.join(distDir, 'lib', entry) shutil.move(os.path.join(distDir, entry), filename) rpaths = '', '..' try:
This "standard" was discussed between the authors of WinPython, PortablePython and Pyzo. Developers can use the appdata_dir() function from https://bitbucket.org/pyzo/pyzolib/src/tip/paths.py to use this standard. For more info, contact either of us. """.lstrip() with open(os.path.join(distDir, '_settings', 'README.txt'), 'wb') as file: file.write(SETTINGS_TEXT.encode('utf-8')) ## Post processing # Set search path of dynamic libraries from pyzolib import dllutils if sys.platform.startswith('linux'): # Exe dllutils.set_search_path(os.path.join(distDir, 'pyzo'), '', 'lib') # Libs os.mkdir(os.path.join(distDir, 'lib')) for entry in os.listdir(distDir): filename = os.path.join(distDir, entry) if not os.path.isfile(filename): continue if not (entry.endswith('.so') or '.so.' in entry): continue # rpaths = '', 'lib' if entry.startswith('lib') and not 'python' in entry: filename = os.path.join(distDir, 'lib', entry) shutil.move(os.path.join(distDir, entry), filename) rpaths = '', '..' try:
""".lstrip() with open(os.path.join(distDir, '_settings', 'README.txt'), 'wb') as file: file.write(SETTINGS_TEXT.encode('utf-8')) ## Post processing # Set search path of dynamic libraries from pyzolib import dllutils if sys.platform.startswith('linux'): for entry in os.listdir(distDir): entry = os.path.join(distDir, entry) if os.path.isfile(entry): if entry.endswith('.so') or '.so.' in entry: dllutils.set_search_path(entry, '') # Set qt.conf # Prevent loading plugins form the system plugin dir, which # may cause incompatibility conflicts. # see issue 138 and issue 198. with open(os.path.join(distDir, 'qt.conf'), 'wb') as file: file.write("[Paths]\nPlugins = '.'\n".encode('utf-8')) # todo: this is now in cx_Freeze right? if applicationBundle: #Change the absolute paths in all library files to relative paths #This should be a cx_freeze task, but cx_freeze doesn't do it shippedfiles=os.listdir(distDir)