65
65
'package_data': {'bzrlib': ['doc/api/*.txt',
66
66
'tests/test_patches_data/*',
67
67
'help_topics/en/*.txt',
68
'tests/ssl_certs/server_without_pass.key',
69
'tests/ssl_certs/server_with_pass.key',
70
'tests/ssl_certs/server.crt'
400
404
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
403
def get_qbzr_py2exe_info(includes, excludes, packages):
407
def get_qbzr_py2exe_info(includes, excludes, packages, data_files):
404
408
# PyQt4 itself still escapes the plugin detection code for some reason...
405
409
packages.append('PyQt4')
406
410
excludes.append('PyQt4.elementtree.ElementTree')
414
418
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
415
419
qscintilla2.dll""".split())
416
420
# 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
421
# They seem to install to a place like C:\Python25\PyQt4\*
422
# Which is not the same as C:\Python25\Lib\site-packages\PyQt4
423
pyqt_dir = os.path.join(sys.prefix, "PyQt4")
424
pyqt_bin_dir = os.path.join(pyqt_dir, "bin")
425
if os.path.isdir(pyqt_bin_dir):
426
path = os.environ.get("PATH", "")
427
if pyqt_bin_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
428
os.environ["PATH"] = path + os.pathsep + pyqt_bin_dir
429
# also add all imageformat plugins to distribution
430
# We will look in 2 places, dirname(PyQt4.__file__) and pyqt_dir
431
base_dirs_to_check = []
432
if os.path.isdir(pyqt_dir):
433
base_dirs_to_check.append(pyqt_dir)
439
pyqt4_base_dir = os.path.dirname(PyQt4.__file__)
440
if pyqt4_base_dir != pyqt_dir:
441
base_dirs_to_check.append(pyqt4_base_dir)
442
if not base_dirs_to_check:
443
log.warn("Can't find PyQt4 installation -> not including imageformat"
447
for base_dir in base_dirs_to_check:
448
plug_dir = os.path.join(base_dir, 'plugins', 'imageformats')
449
if os.path.isdir(plug_dir):
450
for fname in os.listdir(plug_dir):
451
# Include plugin dlls, but not debugging dlls
452
fullpath = os.path.join(plug_dir, fname)
453
if fname.endswith('.dll') and not fname.endswith('d4.dll'):
454
files.append(fullpath)
456
data_files.append(('imageformats', files))
458
log.warn('PyQt4 was found, but we could not find any imageformat'
459
' plugins. Are you sure your configuration is correct?')
423
462
def get_svn_py2exe_info(includes, excludes, packages):
505
544
version = version_str,
506
545
description = META_INFO['description'],
507
546
author = META_INFO['author'],
508
copyright = "(c) Canonical Ltd, 2005-2007",
547
copyright = "(c) Canonical Ltd, 2005-2009",
509
548
company_name = "Canonical Ltd.",
510
549
comments = META_INFO['description'],
600
639
data_files = topics_files + plugins_files
602
641
if 'qbzr' in plugins:
603
get_qbzr_py2exe_info(includes, excludes, packages)
642
get_qbzr_py2exe_info(includes, excludes, packages, data_files)
605
644
if 'svn' in plugins:
606
645
get_svn_py2exe_info(includes, excludes, packages)