def _collect_tkfiles(mod): # Workaround for broken Tcl/Tk detection in virtualenv on Windows. _handle_broken_tk() tcl_root, tk_root = _find_tk(mod) if not tcl_root: logger.error( "TCL/TK seams to be not properly installed on this system") return [] tcldir = "tcl" tkdir = "tk" tcltree = Tree(tcl_root, os.path.join('_MEI', tcldir), excludes=['demos', '*.lib', 'tclConfig.sh']) if is_darwin: # handle workaround for ActiveTcl on OS X _warn_if_actvivetcl_or_teapot_install(tcl_root, tcltree) tktree = Tree(tk_root, os.path.join('_MEI', tkdir), excludes=['demos', '*.lib', 'tkConfig.sh']) return (tcltree + tktree)
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')
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')
def _collect_tkfiles(mod): # Workaround for broken Tcl/Tk detection in virtualenv on Windows. _handle_broken_tk() tcl_root, tk_root = _find_tk(mod) if not tcl_root: logger.error("TCL/TK seams to be not properly installed on this system") return [] tcldir = "tcl" tkdir = "tk" tcltree = Tree(tcl_root, os.path.join("_MEI", tcldir), excludes=["demos", "*.lib", "tclConfig.sh"]) tktree = Tree(tk_root, os.path.join("_MEI", tkdir), excludes=["demos", "*.lib", "tkConfig.sh"]) return tcltree + tktree
def hook(mod): # get the shared libs used by _tkinter.so (resp. .dll, et al) binaries = bindepend.selectImports(mod.__file__) if is_win: tcl_tk = find_tk_win(binaries) elif is_darwin: tcl_tk = find_tk_darwin(binaries) elif is_unix: tcl_tk = find_tk_unix(binaries) else: # If no pattern is in place for this platform, skip TCL/TK detection. tcl_tk = -1 if tcl_tk == -1: logger.info("... skipping TCL/TK detection on this platform (%s)", sys.platform) elif tcl_tk is None: logger.error("could not find TCL/TK") else: mod.datas.extend(collect_tkfiles(*tcl_tk)) return mod
def hook(mod): # get the shared libs used by _tkinter.so (resp. .dll, et al) binaries = bindepend.selectImports(mod.__file__) if is_win: tcl_tk = find_tk_win(binaries) elif is_darwin: tcl_tk = find_tk_darwin(binaries) elif is_unix: tcl_tk = find_tk_unix(binaries) else: # If no pattern is in place for this platform, skip TCL/TK detection. tcl_tk = -1 if tcl_tk == -1: logger.info("... skipping TCL/TK detection on this platform (%s)", sys.platform) elif tcl_tk is None: logger.error("could not find TCL/TK") else: mod.datas.extend(collect_tkfiles(*tcl_tk)) return mod
def _collect_tkfiles(mod): # Workaround for broken Tcl/Tk detection in virtualenv on Windows. _handle_broken_tk() tcl_root, tk_root = _find_tk(mod) if not tcl_root: logger.error("TCL/TK seams to be not properly installed on this system") return [] tcldir = "tcl" tkdir = "tk" tcltree = Tree(tcl_root, os.path.join('_MEI', tcldir), excludes=['demos', '*.lib', 'tclConfig.sh']) if is_darwin: # handle workaround for ActiveTcl on OS X _warn_if_actvivetcl_or_teapot_install(tcl_root, tcltree) tktree = Tree(tk_root, os.path.join('_MEI', tkdir), excludes=['demos', '*.lib', 'tkConfig.sh']) return (tcltree + tktree)