/scripts/check_eggs.py
https://bitbucket.org/cistrome/cistrome-harvard/ · Python · 41 lines · 26 code · 8 blank · 7 comment · 4 complexity · 2d4f18cee67a24cec3f8987330fcf0a1 MD5 · raw file
- #!/usr/bin/env python
- """
- Compares local dependency eggs to those in eggs.ini, displaying a warning if
- any are out of date.
- usage: check_eggs.py [options]
- """
- import os, sys, logging
- from optparse import OptionParser
- parser = OptionParser()
- parser.add_option( '-c', '--config', dest='config', help='Path to Galaxy config file (universe_wsgi.ini)', default='universe_wsgi.ini' )
- parser.add_option( '-q', '--quiet', dest='quiet', action="store_true", help='Quiet (no output, only set return code)', default=False )
- ( options, args ) = parser.parse_args()
- if not os.path.exists( options.config ):
- print "Config file does not exist (see 'python %s --help'): %s" % ( sys.argv[0], options.config )
- sys.exit( 1 )
- root = logging.getLogger()
- root.setLevel( 10 )
- root.addHandler( logging.StreamHandler( sys.stdout ) )
- config_arg = ''
- if options.config != 'universe_wsgi.ini':
- config_arg = '-c %s' % options.config
- lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), "..", "lib" ) )
- sys.path.append( lib )
- from galaxy.eggs import Crate
- c = Crate( options.config )
- if c.config_missing:
- if not options.quiet:
- print "Some of your Galaxy eggs are out of date. Please update them"
- print "by running:"
- print " python scripts/fetch_eggs.py %s" % config_arg
- sys.exit( 1 )
- sys.exit( 0 )