/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Vincent Ladeuil
  • Date: 2008-09-11 19:36:38 UTC
  • mfrom: (3703 +trunk)
  • mto: (3705.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 3708.
  • Revision ID: v.ladeuil+lp@free.fr-20080911193638-wtjyc1kcmacc6t1f
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
228
228
add_pyrex_extension('bzrlib._btree_serializer_c')
229
229
add_pyrex_extension('bzrlib._dirstate_helpers_c')
230
230
add_pyrex_extension('bzrlib._knit_load_data_c')
 
231
add_pyrex_extension('bzrlib._readdir_pyx')
231
232
if sys.platform == 'win32':
232
233
    # pyrex uses the macro WIN32 to detect the platform, even though it should
233
234
    # be using something like _WIN32 or MS_WINDOWS, oh well, we can give it the
252
253
    # win32com uses them.  Hook this in so win32com.shell is found.
253
254
    import modulefinder
254
255
    import win32com
 
256
    import cPickle as pickle
255
257
    for p in win32com.__path__[1:]:
256
258
        modulefinder.AddPackagePath("win32com", p)
257
259
    for extra in ["win32com.shell"]:
270
272
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
271
273
 
272
274
    packages.append("tbzrlib")
 
275
 
 
276
    # collect up our icons.
 
277
    cwd = os.getcwd()
 
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))]
 
297
 
273
298
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
274
299
                       win32ui crawler.Crawler""".split())
275
300
 
283
308
    # GUI version that is generally used.
284
309
    tbzrcache = dict(
285
310
        script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
286
 
        icon_resources = [(0,'bzr.ico')],
 
311
        icon_resources = icon_resources,
 
312
        other_resources = other_resources,
287
313
    )
288
314
    console_targets.append(tbzrcache)
289
315