root/galaxy-central/scripts/fetch_eggs.py @ 2

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

import galaxy-central

  • 属性 svn:executable の設定値 *
行番号 
1"""
2usage: fetch_eggs.py [egg_name] [platform]
3    With no arguments, fetches all eggs necessary according to the
4    settings in universe_wsgi.ini.
5  egg_name - Fetch only this egg (as defined in eggs.ini) or 'all' for
6    all eggs (even those not required by your settings).
7  platform - Fetch eggs for a specific platform (if not provided, fetch
8    eggs for *this* platform).  Useful for fetching eggs for cluster
9    nodes which are of a different architecture than the head node.
10    Platform name can be determined with the get_platforms.py script.
11"""
12import os, sys, logging
13
14root = logging.getLogger()
15root.setLevel( 10 )
16root.addHandler( logging.StreamHandler( sys.stdout ) )
17
18lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "..", "lib" ) )
19sys.path.append( lib )
20
21from galaxy.eggs import Crate, EggNotFetchable
22import pkg_resources
23
24try:
25    c = Crate( platform = sys.argv[2] )
26except:
27    c = Crate()
28try:
29    if len( sys.argv ) == 1:
30        c.resolve() # Only fetch eggs required by the config
31    elif sys.argv[1] == 'all':
32        c.resolve( all=True ) # Fetch everything
33    else:
34        # Fetch a specific egg
35        name = sys.argv[1]
36        try:
37            egg = c[name]
38        except:
39            print "error: %s not in eggs.ini" % name
40            sys.exit( 1 )
41        dist = egg.resolve()[0]
42        print "%s %s is installed at %s" % ( dist.project_name, dist.version, dist.location )
43except EggNotFetchable, e:
44    try:
45        assert sys.argv[1] != 'all'
46        egg = e.eggs[0]
47        print "%s %s couldn't be downloaded automatically.  You can try" % ( egg.name, egg.version )
48        print "building it by hand with:"
49        print "  python scripts/scramble.py %s"
50    except ( AssertionError, IndexError ):
51        print "One or more of the python eggs necessary to run Galaxy couldn't be"
52        print "downloaded automatically.  You can try building them by hand (all"
53        print "at once) with:"
54        print "  python scripts/scramble.py"
55        print "Or individually:"
56        for egg in e.eggs:
57            print "  python scripts/scramble.py %s" % egg.name
58    sys.exit( 1 )
59sys.exit( 0 )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。