242
242
print 'The python versions will be used instead.'
245
def get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
247
packages.append('tbzrcommands')
249
# ModuleFinder can't handle runtime changes to __path__, but
250
# win32com uses them. Hook this in so win32com.shell is found.
253
for p in win32com.__path__[1:]:
254
modulefinder.AddPackagePath("win32com", p)
255
for extra in ["win32com.shell"]:
257
m = sys.modules[extra]
258
for p in m.__path__[1:]:
259
modulefinder.AddPackagePath(extra, p)
261
# TBZR points to the TBZR directory
262
tbzr_root = os.environ["TBZR"]
264
# Ensure tbzrlib itself is on sys.path
265
sys.path.append(tbzr_root)
267
# Ensure our COM "entry-point" is on sys.path
268
sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
270
packages.append("tbzrlib")
271
excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
272
win32ui crawler.Crawler""".split())
276
create_exe = False, # we only want a .dll
278
com_targets.append(tbzr)
280
# tbzrcache executables - a "console" version for debugging and a
281
# GUI version that is generally used.
283
script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
284
icon_resources = [(0,'bzr.ico')],
286
console_targets.append(tbzrcache)
288
# Make a windows version which is the same except for the base name.
289
tbzrcachew = tbzrcache.copy()
290
tbzrcachew["dest_base"]="tbzrcachew"
291
gui_targets.append(tbzrcachew)
293
# ditto for the tbzrcommand tool
295
script = os.path.join(tbzr_root, "Scripts", "tbzrcommand.py"),
296
icon_resources = [(0,'bzr.ico')],
298
console_targets.append(tbzrcommand)
299
tbzrcommandw = tbzrcommand.copy()
300
tbzrcommandw["dest_base"]="tbzrcommandw"
301
gui_targets.append(tbzrcommandw)
305
script = os.path.join(tbzr_root, "Scripts", "tbzrtest.py"),
307
console_targets.append(tbzrtest)
309
# A utility to see python output from the shell extension - this will
310
# die when we get a c++ extension
311
# any .py file from pywin32's win32 lib will do (other than
312
# win32traceutil itself that is)
314
win32_lib_dir = os.path.dirname(winerror.__file__)
315
tracer = dict(script = os.path.join(win32_lib_dir, "win32traceutil.py"),
316
dest_base="tbzr_tracer")
317
console_targets.append(tracer)
319
def get_qbzr_py2exe_info(includes, excludes, packages):
320
# PyQt4 itself still escapes the plugin detection code for some reason...
321
packages.append('PyQt4')
322
excludes.append('PyQt4.elementtree.ElementTree')
323
includes.append('sip') # extension module required for Qt.
324
packages.append('pygments') # colorizer for qbzr
325
# but we can avoid many Qt4 Dlls.
327
"""QtAssistantClient4.dll QtCLucene4.dll QtDesigner4.dll
328
QtHelp4.dll QtNetwork4.dll QtOpenGL4.dll QtScript4.dll
329
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
330
qscintilla2.dll""".split())
331
# the qt binaries might not be on PATH...
332
qt_dir = os.path.join(sys.prefix, "PyQt4", "bin")
333
path = os.environ.get("PATH","")
334
if qt_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
335
os.environ["PATH"] = path + os.pathsep + qt_dir
246
338
if 'bdist_wininst' in sys.argv:
413
505
if 'qbzr' in plugins:
414
# PyQt4 itself still escapes the plugin detection code for some reason...
415
packages.append('PyQt4')
416
excludes.append('PyQt4.elementtree.ElementTree')
417
includes.append('sip') # extension module required for Qt.
418
packages.append('pygments') # colorizer for qbzr
419
# but we can avoid many Qt4 Dlls.
421
"""QtAssistantClient4.dll QtCLucene4.dll QtDesigner4.dll
422
QtHelp4.dll QtNetwork4.dll QtOpenGL4.dll QtScript4.dll
423
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
424
qscintilla2.dll""".split())
425
# the qt binaries might not be on PATH...
426
qt_dir = os.path.join(sys.prefix, "PyQt4", "bin")
427
path = os.environ.get("PATH","")
428
if qt_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
429
os.environ["PATH"] = path + os.pathsep + qt_dir
506
get_qbzr_py2exe_info(includes, excludes, packages)
431
508
if "TBZR" in os.environ:
432
509
# Eg: via SVN: http://tortoisesvn.tigris.org/svn/tortoisesvn/TortoiseOverlays/version-1.0.4/bin/TortoiseOverlays-1.0.4.11886-win32.msi
433
510
if not os.path.isfile(os.environ.get('TOVMSI_WIN32', '<nofile>')):
434
511
raise RuntimeError, "Please set TOVMSI_WIN32 to the location of " \
435
512
"the TortoiseOverlays .msi installerfile"
437
packages.append('tbzrcommands')
439
# ModuleFinder can't handle runtime changes to __path__, but
440
# win32com uses them. Hook this in so win32com.shell is found.
443
for p in win32com.__path__[1:]:
444
modulefinder.AddPackagePath("win32com", p)
445
for extra in ["win32com.shell"]:
447
m = sys.modules[extra]
448
for p in m.__path__[1:]:
449
modulefinder.AddPackagePath(extra, p)
451
# TBZR points to the TBZR directory
452
tbzr_root = os.environ["TBZR"]
454
# Ensure tbzrlib itself is on sys.path
455
sys.path.append(tbzr_root)
457
# Ensure our COM "entry-point" is on sys.path
458
sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
460
packages.append("tbzrlib")
461
excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
462
win32ui crawler.Crawler""".split())
466
create_exe = False, # we only want a .dll
468
com_targets.append(tbzr)
470
# tbzrcache executables - a "console" version for debugging and a
471
# GUI version that is generally used.
473
script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
474
icon_resources = [(0,'bzr.ico')],
476
console_targets.append(tbzrcache)
478
# Make a windows version which is the same except for the base name.
479
tbzrcachew = tbzrcache.copy()
480
tbzrcachew["dest_base"]="tbzrcachew"
481
gui_targets.append(tbzrcachew)
483
# ditto for the tbzrcommand tool
485
script = os.path.join(tbzr_root, "Scripts", "tbzrcommand.py"),
486
icon_resources = [(0,'bzr.ico')],
488
console_targets.append(tbzrcommand)
489
tbzrcommandw = tbzrcommand.copy()
490
tbzrcommandw["dest_base"]="tbzrcommandw"
491
gui_targets.append(tbzrcommandw)
495
script = os.path.join(tbzr_root, "Scripts", "tbzrtest.py"),
497
console_targets.append(tbzrtest)
499
# A utility to see python output from the shell extension - this will
500
# die when we get a c++ extension
501
# any .py file from pywin32's win32 lib will do (other than
502
# win32traceutil itself that is)
504
win32_lib_dir = os.path.dirname(winerror.__file__)
505
tracer = dict(script = os.path.join(win32_lib_dir, "win32traceutil.py"),
506
dest_base="tbzr_tracer")
507
console_targets.append(tracer)
513
get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
510
516
# print this warning to stderr as output is redirected, so it is seen
511
517
# at build time. Also to stdout so it appears in the log