root/galaxy-central/scripts/make_egg_packager.py

リビジョン 2, 1.8 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1#!/usr/bin/env python
2
3import os, sys, logging, shutil
4
5root = logging.getLogger()
6root.setLevel( 10 )
7root.addHandler( logging.StreamHandler( sys.stdout ) )
8
9lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "..", "lib" ) )
10sys.path.append( lib )
11
12from galaxy.eggs import Crate, EggNotFetchable, py
13import pkg_resources
14
15try:
16    platform = sys.argv[1]
17    c = Crate( platform = platform )
18    print "Platform forced to '%s'" % platform
19except:
20    platform = '-'.join( ( py, pkg_resources.get_platform() ) )
21    c = Crate()
22    print "Using Python interpreter at %s, Version %s" % ( sys.executable, sys.version )
23    print "This platform is '%s'" % platform
24    print "Override with:"
25    print "  make_egg_packager.py <forced-platform>"
26
27shutil.copy( os.path.join( os.path.dirname( __file__ ), 'egg_packager_template.py' ), 'egg_packager-%s.py' % platform )
28
29packager = open( 'egg_packager-%s.py' % platform, 'a' )
30packager.write( "py = '%s'\n" % py )
31packager.write( "url = '%s'\n" % c.repo )
32packager.write( "platform = '%s'\n" % platform )
33packager.write( "dists = [\n" )
34
35for egg in c.all_eggs:
36    if egg.name in c.no_auto:
37        continue
38    packager.write( "          Distribution( '%s', '%s', '%s', '%s', '%s' ),\n" % ( egg.distribution.egg_name(), egg.distribution.project_name, egg.distribution.version, egg.distribution.py_version, egg.distribution.platform ) )
39
40packager.write( """]
41
42for d in dists:
43    e = Egg( d )
44    if not e.fetch( None ):
45        failures.append( e )
46
47if failures:
48    print ""
49    print "Failed:"
50    for e in failures:
51        print e.distribution.project_name
52else:
53    create_zip()
54clean()
55""" )
56
57print "Completed packager is 'egg_packager-%s.py'.  To" % platform
58print "fetch eggs, please copy this file to a system with internet access and run"
59print "with:"
60print "  python egg_packager-%s.py" % platform
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。