400
401
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
403
def get_qbzr_py2exe_info(includes, excludes, packages):
404
def get_qbzr_py2exe_info(includes, excludes, packages, data_files):
404
405
# PyQt4 itself still escapes the plugin detection code for some reason...
405
406
packages.append('PyQt4')
406
407
excludes.append('PyQt4.elementtree.ElementTree')
414
415
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
415
416
qscintilla2.dll""".split())
416
417
# the qt binaries might not be on PATH...
417
qt_dir = os.path.join(sys.prefix, "PyQt4", "bin")
418
path = os.environ.get("PATH","")
419
if qt_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
420
os.environ["PATH"] = path + os.pathsep + qt_dir
418
# They seem to install to a place like C:\Python25\PyQt4\*
419
# Which is not the same as C:\Python25\Lib\site-packages\PyQt4
420
pyqt_dir = os.path.join(sys.prefix, "PyQt4")
421
pyqt_bin_dir = os.path.join(pyqt_dir, "bin")
422
if os.path.isdir(pyqt_bin_dir):
423
path = os.environ.get("PATH", "")
424
if pyqt_bin_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
425
os.environ["PATH"] = path + os.pathsep + pyqt_bin_dir
426
# also add all imageformat plugins to distribution
427
# We will look in 2 places, dirname(PyQt4.__file__) and pyqt_dir
428
base_dirs_to_check = []
429
if os.path.isdir(pyqt_dir):
430
base_dirs_to_check.append(pyqt_dir)
436
pyqt4_base_dir = os.path.dirname(PyQt4.__file__)
437
if pyqt4_base_dir != pyqt_dir:
438
base_dirs_to_check.append(pyqt4_base_dir)
439
if not base_dirs_to_check:
440
log.warn("Can't find PyQt4 installation -> not including imageformat"
444
for base_dir in base_dirs_to_check:
445
plug_dir = os.path.join(base_dir, 'plugins', 'imageformats')
446
if os.path.isdir(plug_dir):
447
for fname in os.listdir(plug_dir):
448
# Include plugin dlls, but not debugging dlls
449
fullpath = os.path.join(plug_dir, fname)
450
if fname.endswith('.dll') and not fname.endswith('d4.dll'):
451
files.append(fullpath)
453
data_files.append(('imageformats', files))
455
log.warn('PyQt4 was found, but we could not find any imageformat'
456
' plugins. Are you sure your configuration is correct?')
423
459
def get_svn_py2exe_info(includes, excludes, packages):
600
636
data_files = topics_files + plugins_files
602
638
if 'qbzr' in plugins:
603
get_qbzr_py2exe_info(includes, excludes, packages)
639
get_qbzr_py2exe_info(includes, excludes, packages, data_files)
605
641
if 'svn' in plugins:
606
642
get_svn_py2exe_info(includes, excludes, packages)