253
253
# win32com uses them. Hook this in so win32com.shell is found.
254
254
import modulefinder
256
import cPickle as pickle
256
257
for p in win32com.__path__[1:]:
257
258
modulefinder.AddPackagePath("win32com", p)
258
259
for extra in ["win32com.shell"]:
271
272
sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
273
274
packages.append("tbzrlib")
276
# collect up our icons.
278
ico_root = os.path.join(tbzr_root, 'tbzrlib', 'resources')
279
icos = [] # list of (path_root, relative_ico_path)
280
# First always bzr's icon and its in the root of the bzr tree.
281
icos.append(('', 'bzr.ico'))
282
for root, dirs, files in os.walk(ico_root):
283
icos.extend([(ico_root, os.path.join(root, f)[len(ico_root)+1:])
284
for f in files if f.endswith('.ico')])
285
# allocate an icon ID for each file and the full path to the ico
286
icon_resources = [(rid, os.path.join(ico_dir, ico_name))
287
for rid, (ico_dir, ico_name) in enumerate(icos)]
288
# create a string resource with the mapping. Might as well save the
289
# runtime some effort and write a pickle.
290
# Runtime expects unicode objects with forward-slash seps.
291
fse = sys.getfilesystemencoding()
292
map_items = [(f.replace('\\', '/').decode(fse), rid)
293
for rid, (_, f) in enumerate(icos)]
294
ico_map = dict(map_items)
295
# Create a new resource type of 'ICON_MAP', and use ID=1
296
other_resources = [ ("ICON_MAP", 1, pickle.dumps(ico_map))]
274
298
excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
275
299
win32ui crawler.Crawler""".split())
284
308
# GUI version that is generally used.
285
309
tbzrcache = dict(
286
310
script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
287
icon_resources = [(0,'bzr.ico')],
311
icon_resources = icon_resources,
312
other_resources = other_resources,
289
314
console_targets.append(tbzrcache)
326
351
excludes.append('PyQt4.elementtree.ElementTree')
327
352
includes.append('sip') # extension module required for Qt.
328
353
packages.append('pygments') # colorizer for qbzr
354
packages.append('docutils') # html formatting
329
355
# but we can avoid many Qt4 Dlls.
330
356
dll_excludes.extend(
331
357
"""QtAssistantClient4.dll QtCLucene4.dll QtDesigner4.dll
484
510
plugins = set(dirs)
487
if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll"]:
513
if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
489
515
if i == '__init__.py' and root == 'bzrlib/plugins':