290
290
def get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
291
gui_targets, data_files):
292
292
packages.append('tbzrcommands')
294
294
# ModuleFinder can't handle runtime changes to __path__, but
340
340
excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
341
341
win32ui crawler.Crawler""".split())
343
# NOTE: We still create a DLL version of the Python implemented shell
344
# extension for testing purposes - but it is *not* registered by
345
# default - our C++ one is instead. To discourage people thinking
346
# this DLL is still necessary, its called 'tbzr_old.dll'
344
348
modules=["tbzr"],
345
349
create_exe = False, # we only want a .dll
350
dest_base = 'tbzr_old',
347
352
com_targets.append(tbzr)
349
354
# tbzrcache executables - a "console" version for debugging and a
350
355
# GUI version that is generally used.
351
356
tbzrcache = dict(
352
script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
357
script = os.path.join(tbzr_root, "scripts", "tbzrcache.py"),
353
358
icon_resources = icon_resources,
354
359
other_resources = other_resources,
363
368
# ditto for the tbzrcommand tool
364
369
tbzrcommand = dict(
365
script = os.path.join(tbzr_root, "Scripts", "tbzrcommand.py"),
370
script = os.path.join(tbzr_root, "scripts", "tbzrcommand.py"),
366
371
icon_resources = [(0,'bzr.ico')],
368
373
console_targets.append(tbzrcommand)
370
375
tbzrcommandw["dest_base"]="tbzrcommandw"
371
376
gui_targets.append(tbzrcommandw)
375
script = os.path.join(tbzr_root, "Scripts", "tbzrtest.py"),
377
console_targets.append(tbzrtest)
379
# A utility to see python output from the shell extension - this will
380
# die when we get a c++ extension
381
# any .py file from pywin32's win32 lib will do (other than
382
# win32traceutil itself that is)
384
win32_lib_dir = os.path.dirname(winerror.__file__)
385
tracer = dict(script = os.path.join(win32_lib_dir, "win32traceutil.py"),
386
dest_base="tbzr_tracer")
378
# A utility to see python output from both C++ and Python based shell
380
tracer = dict(script=os.path.join(tbzr_root, "scripts", "tbzrtrace.py"))
387
381
console_targets.append(tracer)
383
# The C++ implemented shell extensions.
384
dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
386
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
387
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
390
390
def get_qbzr_py2exe_info(includes, excludes, packages):
391
391
# PyQt4 itself still escapes the plugin detection code for some reason...
550
550
for root, dirs, files in os.walk('bzrlib/plugins'):
551
551
if root == 'bzrlib/plugins':
552
552
plugins = set(dirs)
553
# py2exe may find references to part of the plugin (eg, the tests)
554
# so we tell py2exe to leave the plugins out of the .zip file
555
excludes.extend(["bzrlib.plugins." + d for d in dirs])
555
558
if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
582
586
# TortoiseOverlays MSI installer file. It is in the TSVN svn repo and
583
587
# can be downloaded from (username=guest, blank password):
584
588
# http://tortoisesvn.tigris.org/svn/tortoisesvn/TortoiseOverlays/version-1.0.4/bin/TortoiseOverlays-1.0.4.11886-win32.msi
585
if not os.path.isfile(os.environ.get('TORTOISE_OVERLAYS_MSI_WIN32',
587
raise RuntimeError("Please set TORTOISE_OVERLAYS_MSI_WIN32 to the"
588
" location of the Win32 TortoiseOverlays .msi"
589
# Ditto for TORTOISE_OVERLAYS_MSI_X64, pointing at *-x64.msi.
590
for needed in ('TORTOISE_OVERLAYS_MSI_WIN32',
591
'TORTOISE_OVERLAYS_MSI_X64'):
592
if not os.path.isfile(os.environ.get(needed, '<nofile>')):
593
raise RuntimeError("Please set %s to the"
594
" location of the relevant TortoiseOverlays"
595
" .msi installer file" % needed)
590
596
get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
597
gui_targets, data_files)
593
599
# print this warning to stderr as output is redirected, so it is seen
594
600
# at build time. Also to stdout so it appears in the log
613
619
windows=gui_targets,
614
620
com_server=com_targets,
615
621
zipfile='lib/library.zip',
616
data_files=topics_files + plugins_files,
622
data_files=data_files,
617
623
cmdclass={'install_data': install_data_with_bytecompile},