mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
The InstallManager is now a stand-alone appication that attempts to load the tool panel as closely as possible to the way it was loaded before tools were migrated from the Galaxy distribution to the tool shed.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import sys, os.path, logging
|
||||
|
||||
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
|
||||
new_path.extend( sys.path[1:] ) # remove scripts/ from the path
|
||||
sys.path = new_path
|
||||
|
||||
from galaxy import eggs
|
||||
|
||||
import pkg_resources
|
||||
pkg_resources.require( "sqlalchemy-migrate" )
|
||||
|
||||
from migrate.versioning.shell import main
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
log = logging.getLogger( __name__ )
|
||||
|
||||
config_file = 'universe_wsgi.ini'
|
||||
if '-c' in sys.argv:
|
||||
pos = sys.argv.index( '-c' )
|
||||
sys.argv.pop( pos )
|
||||
config_file = sys.argv.pop( pos )
|
||||
if not os.path.exists( config_file ):
|
||||
print "Galaxy config file does not exist (hint: use '-c config.ini' for non-standard locations): %s" % config_file
|
||||
sys.exit( 1 )
|
||||
repo = 'lib/galaxy/tool_shed/migrate'
|
||||
|
||||
cp = SafeConfigParser()
|
||||
cp.read( config_file )
|
||||
|
||||
if config_file == 'universe_wsgi.ini.sample' and 'GALAXY_TEST_DBURI' in os.environ:
|
||||
# Running functional tests.
|
||||
db_url = os.environ[ 'GALAXY_TEST_DBURI' ]
|
||||
elif cp.has_option( "app:main", "database_connection" ):
|
||||
db_url = cp.get( "app:main", "database_connection" )
|
||||
elif cp.has_option( "app:main", "database_file" ):
|
||||
db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % cp.get( "app:main", "database_file" )
|
||||
else:
|
||||
db_url = "sqlite:///./database/universe.sqlite?isolation_level=IMMEDIATE"
|
||||
|
||||
dialect_to_egg = {
|
||||
"sqlite" : "pysqlite>=2",
|
||||
"postgres" : "psycopg2",
|
||||
"mysql" : "MySQL_python"
|
||||
}
|
||||
dialect = ( db_url.split( ':', 1 ) )[0]
|
||||
try:
|
||||
egg = dialect_to_egg[dialect]
|
||||
try:
|
||||
pkg_resources.require( egg )
|
||||
log.debug( "%s egg successfully loaded for %s dialect" % ( egg, dialect ) )
|
||||
except:
|
||||
# If the module is in the path elsewhere (i.e. non-egg), it'll still load.
|
||||
log.warning( "%s egg not found, but an attempt will be made to use %s anyway" % ( egg, dialect ) )
|
||||
except KeyError:
|
||||
# Let this go, it could possibly work with db's we don't support
|
||||
log.error( "database_connection contains an unknown SQLAlchemy database dialect: %s" % dialect )
|
||||
|
||||
main( repository=repo, url=db_url )
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd `dirname $0`/../..
|
||||
python ./scripts/migrate_tools/migrate_tools.py 0002_tools.xml $@
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0"?>
|
||||
<toolshed name="toolshed.g2.bx.psu.edu">
|
||||
<repository name="emboss_datatypes" description="Datatypes for Emboss tools" changeset_revision="a89163f31369" />
|
||||
<repository name="emboss_5" description="Galaxy wrappers for EMBOSS version 5.0.0 tools" changeset_revision="b94ca591877b">
|
||||
<tool id="EMBOSS: antigenic1" version="5.0.0" file="emboss_antigenic.xml" />
|
||||
<tool id="EMBOSS: backtranseq2" version="5.0.0" file="emboss_backtranseq.xml" />
|
||||
<tool id="EMBOSS: banana3" version="5.0.0" file="emboss_banana.xml" />
|
||||
<tool id="EMBOSS: biosed4" version="5.0.0" file="emboss_biosed.xml" />
|
||||
<tool id="EMBOSS: btwisted5" version="5.0.0" file="emboss_btwisted.xml" />
|
||||
<tool id="EMBOSS: cai_custom6" version="5.0.0" file="emboss_cai_custom.xml" />
|
||||
<tool id="EMBOSS: cai6" version="5.0.0" file="emboss_cai.xml" />
|
||||
<tool id="EMBOSS: chaos7" version="5.0.0" file="emboss_chaos.xml" />
|
||||
<tool id="EMBOSS: charge8" version="5.0.0" file="emboss_charge.xml" />
|
||||
<tool id="EMBOSS: checktrans9" version="5.0.0" file="emboss_checktrans.xml" />
|
||||
<tool id="EMBOSS: chips10" version="5.0.0" file="emboss_chips.xml" />
|
||||
<tool id="EMBOSS: cirdna11" version="5.0.0" file="emboss_cirdna.xml" />
|
||||
<tool id="EMBOSS: codcmp12" version="5.0.0" file="emboss_codcmp.xml" />
|
||||
<tool id="EMBOSS: coderet13" version="5.0.0" file="emboss_coderet.xml" />
|
||||
<tool id="EMBOSS: compseq14" version="5.0.0" file="emboss_compseq.xml" />
|
||||
<tool id="EMBOSS: cpgplot15" version="5.0.0" file="emboss_cpgplot.xml" />
|
||||
<tool id="EMBOSS: cpgreport16" version="5.0.0" file="emboss_cpgreport.xml" />
|
||||
<tool id="EMBOSS: cusp17" version="5.0.0" file="emboss_cusp.xml" />
|
||||
<tool id="EMBOSS: cutseq18" version="5.0.0" file="emboss_cutseq.xml" />
|
||||
<tool id="EMBOSS: dan19" version="5.0.0" file="emboss_dan.xml" />
|
||||
<tool id="EMBOSS: degapseq20" version="5.0.0" file="emboss_degapseq.xml" />
|
||||
<tool id="EMBOSS: descseq21" version="5.0.0" file="emboss_descseq.xml" />
|
||||
<tool id="EMBOSS: diffseq22" version="5.0.0" file="emboss_diffseq.xml" />
|
||||
<tool id="EMBOSS: digest23" version="5.0.0" file="emboss_digest.xml" />
|
||||
<tool id="EMBOSS: dotmatcher24" version="5.0.0" file="emboss_dotmatcher.xml" />
|
||||
<tool id="EMBOSS: dotpath25" version="5.0.0" file="emboss_dotpath.xml" />
|
||||
<tool id="EMBOSS: dottup26" version="5.0.0" file="emboss_dottup.xml" />
|
||||
<tool id="EMBOSS: dreg27" version="5.0.0" file="emboss_dreg.xml" />
|
||||
<tool id="EMBOSS: einverted28" version="5.0.0" file="emboss_einverted.xml" />
|
||||
<tool id="EMBOSS: epestfind29" version="5.0.0" file="emboss_epestfind.xml" />
|
||||
<tool id="EMBOSS: equicktandem31" version="5.0.0" file="emboss_equicktandem.xml" />
|
||||
<tool id="EMBOSS: est2genome32" version="5.0.0" file="emboss_est2genome.xml" />
|
||||
<tool id="EMBOSS: etandem33" version="5.0.0" file="emboss_etandem.xml" />
|
||||
<tool id="EMBOSS: extractfeat34" version="5.0.0" file="emboss_extractfeat.xml" />
|
||||
<tool id="EMBOSS: extractseq35" version="5.0.0" file="emboss_extractseq.xml" />
|
||||
<tool id="EMBOSS: freak36" version="5.0.0" file="emboss_freak.xml" />
|
||||
<tool id="EMBOSS: fuzznuc37" version="5.0.0" file="emboss_fuzznuc.xml" />
|
||||
<tool id="EMBOSS: fuzzpro38" version="5.0.0" file="emboss_fuzzpro.xml" />
|
||||
<tool id="EMBOSS: fuzztran39" version="5.0.0" file="emboss_fuzztran.xml" />
|
||||
<tool id="EMBOSS: garnier40" version="5.0.0" file="emboss_garnier.xml" />
|
||||
<tool id="EMBOSS: geecee41" version="5.0.0" file="emboss_geecee.xml" />
|
||||
<tool id="EMBOSS: getorf42" version="5.0.0" file="emboss_getorf.xml" />
|
||||
<tool id="EMBOSS: helixturnhelix43" version="5.0.0" file="emboss_helixturnhelix.xml" />
|
||||
<tool id="EMBOSS: hmoment44" version="5.0.0" file="emboss_hmoment.xml" />
|
||||
<tool id="EMBOSS: iep45" version="5.0.0" file="emboss_iep.xml" />
|
||||
<tool id="EMBOSS: infoseq46" version="5.0.0" file="emboss_infoseq.xml" />
|
||||
<tool id="EMBOSS: isochore47" version="5.0.0" file="emboss_isochore.xml" />
|
||||
<tool id="EMBOSS: lindna48" version="5.0.0" file="emboss_lindna.xml" />
|
||||
<tool id="EMBOSS: marscan49" version="5.0.0" file="emboss_marscan.xml" />
|
||||
<tool id="EMBOSS: maskfeat50" version="5.0.0" file="emboss_maskfeat.xml" />
|
||||
<tool id="EMBOSS: maskseq51" version="5.0.0" file="emboss_maskseq.xml" />
|
||||
<tool id="EMBOSS: matcher52" version="5.0.0" file="emboss_matcher.xml" />
|
||||
<tool id="EMBOSS: megamerger53" version="5.0.0" file="emboss_megamerger.xml" />
|
||||
<tool id="EMBOSS: merger54" version="5.0.0" file="emboss_merger.xml" />
|
||||
<tool id="EMBOSS: msbar55" version="5.0.0" file="emboss_msbar.xml" />
|
||||
<tool id="EMBOSS: needle56" version="5.0.0" file="emboss_needle.xml" />
|
||||
<tool id="EMBOSS: newcpgreport57" version="5.0.0" file="emboss_newcpgreport.xml" />
|
||||
<tool id="EMBOSS: newcpgseek58" version="5.0.0" file="emboss_newcpgseek.xml" />
|
||||
<tool id="EMBOSS: newseq59" version="5.0.0" file="emboss_newseq.xml" />
|
||||
<tool id="EMBOSS: noreturn60" version="5.0.0" file="emboss_noreturn.xml" />
|
||||
<tool id="EMBOSS: notseq61" version="5.0.0" file="emboss_notseq.xml" />
|
||||
<tool id="EMBOSS: nthseq62" version="5.0.0" file="emboss_nthseq.xml" />
|
||||
<tool id="EMBOSS: octanol63" version="5.0.0" file="emboss_octanol.xml" />
|
||||
<tool id="EMBOSS: oddcomp64" version="5.0.0" file="emboss_oddcomp.xml" />
|
||||
<tool id="EMBOSS: palindrome65" version="5.0.0" file="emboss_palindrome.xml" />
|
||||
<tool id="EMBOSS: pasteseq66" version="5.0.0" file="emboss_pasteseq.xml" />
|
||||
<tool id="EMBOSS: patmatdb67" version="5.0.0" file="emboss_patmatdb.xml" />
|
||||
<tool id="EMBOSS: pepcoil68" version="5.0.0" file="emboss_pepcoil.xml" />
|
||||
<tool id="EMBOSS: pepinfo69" version="5.0.0" file="emboss_pepinfo.xml" />
|
||||
<tool id="EMBOSS: pepnet70" version="5.0.0" file="emboss_pepnet.xml" />
|
||||
<tool id="EMBOSS: pepstats71" version="5.0.0" file="emboss_pepstats.xml" />
|
||||
<tool id="EMBOSS: pepwheel72" version="5.0.0" file="emboss_pepwheel.xml" />
|
||||
<tool id="EMBOSS: pepwindow73" version="5.0.0" file="emboss_pepwindow.xml" />
|
||||
<tool id="EMBOSS: pepwindowall74" version="5.0.0" file="emboss_pepwindowall.xml" />
|
||||
<tool id="EMBOSS: plotcon75" version="5.0.0" file="emboss_plotcon.xml" />
|
||||
<tool id="EMBOSS: plotorf76" version="5.0.0" file="emboss_plotorf.xml" />
|
||||
<tool id="EMBOSS: polydot77" version="5.0.0" file="emboss_polydot.xml" />
|
||||
<tool id="EMBOSS: preg78" version="5.0.0" file="emboss_preg.xml" />
|
||||
<tool id="EMBOSS: prettyplot79" version="5.0.0" file="emboss_prettyplot.xml" />
|
||||
<tool id="EMBOSS: prettyseq80" version="5.0.0" file="emboss_prettyseq.xml" />
|
||||
<tool id="EMBOSS: primersearch81" version="5.0.0" file="emboss_primersearch.xml" />
|
||||
<tool id="EMBOSS: revseq82" version="5.0.0" file="emboss_revseq.xml" />
|
||||
<tool id="EMBOSS: seqmatchall83" version="5.0.0" file="emboss_seqmatchall.xml" />
|
||||
<tool id="EMBOSS: seqret84" version="5.0.0" file="emboss_seqret.xml" />
|
||||
<tool id="EMBOSS: showfeat85" version="5.0.0" file="emboss_showfeat.xml" />
|
||||
<tool id="EMBOSS: shuffleseq87" version="5.0.0" file="emboss_shuffleseq.xml" />
|
||||
<tool id="EMBOSS: sigcleave88" version="5.0.0" file="emboss_sigcleave.xml" />
|
||||
<tool id="EMBOSS: sirna89" version="5.0.0" file="emboss_sirna.xml" />
|
||||
<tool id="EMBOSS: sixpack90" version="5.0.0" file="emboss_sixpack.xml" />
|
||||
<tool id="EMBOSS: skipseq91" version="5.0.0" file="emboss_skipseq.xml" />
|
||||
<tool id="EMBOSS: splitter92" version="5.0.0" file="emboss_splitter.xml" />
|
||||
<tool id="EMBOSS: supermatcher95" version="5.0.0" file="emboss_supermatcher.xml" />
|
||||
<tool id="EMBOSS: syco96" version="5.0.0" file="emboss_syco.xml" />
|
||||
<tool id="EMBOSS: tcode97" version="5.0.0" file="emboss_tcode.xml" />
|
||||
<tool id="EMBOSS: textsearch98" version="5.0.0" file="emboss_textsearch.xml" />
|
||||
<tool id="EMBOSS: tmap99" version="5.0.0" file="emboss_tmap.xml" />
|
||||
<tool id="EMBOSS: tranalign100" version="5.0.0" file="emboss_tranalign.xml" />
|
||||
<tool id="EMBOSS: transeq101" version="5.0.0" file="emboss_transeq.xml" />
|
||||
<tool id="EMBOSS: trimest102" version="5.0.0" file="emboss_trimest.xml" />
|
||||
<tool id="EMBOSS: trimseq103" version="5.0.0" file="emboss_trimseq.xml" />
|
||||
<tool id="EMBOSS: twofeat104" version="5.0.0" file="emboss_twofeat.xml" />
|
||||
<tool id="EMBOSS: union105" version="5.0.0" file="emboss_union.xml" />
|
||||
<tool id="EMBOSS: vectorstrip106" version="5.0.0" file="emboss_vectorstrip.xml" />
|
||||
<tool id="EMBOSS: water107" version="5.0.0" file="emboss_water.xml" />
|
||||
<tool id="EMBOSS: wobble108" version="5.0.0" file="emboss_wobble.xml" />
|
||||
<tool id="EMBOSS: wordcount109" version="5.0.0" file="emboss_wordcount.xml" />
|
||||
<tool id="EMBOSS: wordmatch110" version="5.0.0" file="emboss_wordmatch.xml" />
|
||||
</repository>
|
||||
</toolshed>
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
"""
|
||||
This script will start up its own web application which includes an InstallManager (~/lib/galaxy/tool_shed/install_manager.py).
|
||||
For each tool discovered missing, the tool shed repository that contains it will be installed on disk and a new entry will be
|
||||
created for it in the migrated_tools_conf.xml file. These entries will be made so that the tool panel will be displayed the same
|
||||
as it was before the tools were eliminated from the Galaxy distribution. The InstallManager will properly handle entries in
|
||||
migrated_tools_conf.xml for tools outside tool panel sections as well as tools inside tool panel sections, depending upon the
|
||||
layout of the local tool_conf.xml file. Entries will not be created in migrated_tools_conf.xml for tools included in the tool
|
||||
shed repository but not defined in tool_conf.xml.
|
||||
"""
|
||||
import sys, os
|
||||
|
||||
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
|
||||
# Remove scripts/ from the path.
|
||||
new_path.extend( sys.path[1:] )
|
||||
sys.path = new_path
|
||||
|
||||
from galaxy import eggs
|
||||
from galaxy.tool_shed.migrate.common import *
|
||||
|
||||
app = MigrateToolsApplication( sys.argv[ 1 ] )
|
||||
non_shed_tool_conf = app.install_manager.proprietary_tool_conf
|
||||
print "\nThe installation process is finished. You should now remove entries for the installed tools from"
|
||||
print "your file named %s and start your Galaxy server." % non_shed_tool_conf
|
||||
app.shutdown()
|
||||
sys.exit( 0 )
|
||||
Reference in New Issue
Block a user