galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
February 2013
- 2 participants
- 189 discussions
commit/galaxy-central: inithello: Enhance twill automated repository installation framework to get a list of repositories from the tool shed API, install, run functional tests defined in the tools' XML, and report success or failure back to the tool shed.
by commits-noreply@bitbucket.org 27 Feb '13
by commits-noreply@bitbucket.org 27 Feb '13
27 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9d87d7c61912/
changeset: 9d87d7c61912
user: inithello
date: 2013-02-27 20:28:12
summary: Enhance twill automated repository installation framework to get a list of repositories from the tool shed API, install, run functional tests defined in the tools' XML, and report success or failure back to the tool shed.
affected #: 3 files
diff -r fabb0ae1edabf77f9aceb018fa5a988ce05500f9 -r 9d87d7c6191284aaf48ade4462256131c0345c8d test/install_and_test_tool_shed_repositories/base/twilltestcase.py
--- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
+++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
@@ -55,7 +55,7 @@
name = repository_info_dict[ 'name' ]
owner = repository_info_dict[ 'owner' ]
changeset_revision = repository_info_dict[ 'changeset_revision' ]
- encoded_repository_id = repository_info_dict[ 'encoded_repository_id' ]
+ encoded_repository_id = repository_info_dict[ 'repository_id' ]
tool_shed_url = repository_info_dict[ 'tool_shed_url' ]
preview_params = urllib.urlencode( dict( repository_id=encoded_repository_id, changeset_revision=changeset_revision ) )
self.visit_url( '%s/repository/preview_tools_in_changeset?%s' % ( tool_shed_url, preview_params ) )
diff -r fabb0ae1edabf77f9aceb018fa5a988ce05500f9 -r 9d87d7c6191284aaf48ade4462256131c0345c8d test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
--- a/test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
+++ b/test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
@@ -3,7 +3,7 @@
from install_and_test_tool_shed_repositories.base.twilltestcase import InstallTestRepository
log = logging.getLogger(__name__)
-class TestInstallRepositories( InstallTestRepository ):
+class InstallTestRepositories( InstallTestRepository ):
"""Abstract test case that installs and uninstalls a predefined list of repositories."""
def do_installation( self, repository_info_dict ):
self.logout()
@@ -35,11 +35,11 @@
G = globals()
# Eliminate all previous tests from G.
for key, val in G.items():
- if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestUninstallRepository_' ):
+ if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestUninstallRepository_' ) or key.startswith( 'TestForTool_' ):
del G[ key ]
# Create a new subclass with a method named install_repository_XXX that installs the repository specified by the provided dict.
name = "TestInstallRepository_" + repository_dict[ 'name' ]
- baseclasses = ( TestInstallRepositories, )
+ baseclasses = ( InstallTestRepositories, )
namespace = dict()
def make_install_method( repository_dict ):
def test_install_repository( self ):
@@ -61,11 +61,11 @@
G = globals()
# Eliminate all previous tests from G.
for key, val in G.items():
- if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestUninstallRepository_' ):
+ if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestUninstallRepository_' ) or key.startswith( 'TestForTool_' ):
del G[ key ]
# Create a new subclass with a method named install_repository_XXX that installs the repository specified by the provided dict.
name = "TestUninstallRepository_" + repository_dict[ 'name' ]
- baseclasses = ( TestInstallRepositories, )
+ baseclasses = ( InstallTestRepositories, )
namespace = dict()
def make_uninstall_method( repository_dict ):
def test_install_repository( self ):
diff -r fabb0ae1edabf77f9aceb018fa5a988ce05500f9 -r 9d87d7c6191284aaf48ade4462256131c0345c8d test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -4,7 +4,7 @@
# order to run functional tests on repository tools after installation. The install_and_test_tool_shed_repositories.sh
# will execute this script with the appropriate parameters.
-import os, sys, shutil, tempfile, re, string
+import os, sys, shutil, tempfile, re, string, urllib
# Assume we are run from the galaxy root directory, add lib to the python path
cwd = os.getcwd()
@@ -19,7 +19,7 @@
default_galaxy_locales = 'en'
default_galaxy_test_file_dir = "test-data"
os.environ[ 'GALAXY_INSTALL_TEST_TMP_DIR' ] = galaxy_test_tmp_dir
-new_path = [ os.path.join( cwd, "lib" ), os.path.join( cwd, 'test' ) ]
+new_path = [ os.path.join( cwd, "lib" ), os.path.join( cwd, 'test' ), os.path.join( cwd, 'scripts', 'api' ) ]
new_path.extend( sys.path )
sys.path = new_path
@@ -48,6 +48,7 @@
from galaxy.app import UniverseApplication
from galaxy.web import buildapp
from galaxy.util import parse_xml
+from galaxy.util.json import from_json_string, to_json_string
import nose.core
import nose.config
@@ -56,6 +57,8 @@
from base.util import parse_tool_panel_config
+from common import update
+
log = logging.getLogger( 'install_and_test_repositories' )
default_galaxy_test_port_min = 10000
@@ -95,7 +98,10 @@
'''
# Define a default location to find the list of repositories to check.
-galaxy_repository_list = os.environ.get( 'GALAXY_INSTALL_TEST_REPOSITORY_FILE', 'repository_list.json' )
+galaxy_repository_list = os.environ.get( 'GALAXY_INSTALL_TEST_REPOSITORY_LIST_LOCATIOM', 'repository_list.json' )
+galaxy_tool_shed_url = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_SHED_URL', 'http://toolshed.local:10001' )
+tool_shed_api_key = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_SHED_API_KEY', None )
+assert tool_shed_api_key is not None, 'Unable to proceed without API key.'
if 'GALAXY_INSTALL_TEST_SECRET' not in os.environ:
galaxy_encode_secret = 'changethisinproductiontoo'
@@ -103,7 +109,28 @@
else:
galaxy_encode_secret = os.environ[ 'GALAXY_INSTALL_TEST_SECRET' ]
-def get_repositories_to_install( format='json' ):
+def get_api_url( base, parts=[], params=None, key=None ):
+ if 'api' in parts and parts.index( 'api' ) != 0:
+ parts.pop( parts.index( 'api' ) )
+ parts.insert( 0, 'api' )
+ elif 'api' not in parts:
+ parts.insert( 0, 'api' )
+ url = '%s/%s' % ( base, '/'.join( parts ) )
+ if key:
+ url += '?%s' % urllib.urlencode( dict( key=key ) )
+ else:
+ url += '?%s' % urllib.urlencode( dict( key=tool_shed_api_key ) )
+ if params:
+ url += '&%s' % params
+ return url
+
+def get_repository_info_from_api( url, repository_info_dict ):
+ parts = [ 'api', 'repositories', repository_info_dict[ 'repository_id' ] ]
+ api_url = get_api_url( base=url, parts=parts )
+ extended_dict = json_from_url( api_url )
+ return extended_dict
+
+def get_repositories_to_install( location, source='file', format='json' ):
'''
Get a list of repository info dicts to install. This method expects a json list of dicts with the following structure:
[
@@ -118,11 +145,34 @@
]
NOTE: If the tool shed URL specified in any dict is not present in the tool_sheds_conf.xml, the installation will fail.
'''
+ if source == 'file':
+ listing = file( location, 'r' ).read()
+ elif source == 'url':
+ assert tool_shed_api_key is not None, 'Cannot proceed without tool shed API key.'
+ params = urllib.urlencode( dict( downloadable='true' ) )
+ api_url = get_api_url( base=location, parts=[ 'repository_revisions' ], params=params )
+ if format == 'json':
+ return json_from_url( api_url )
+ else:
+ raise AssertionError( 'Do not know how to handle source type %s.' % source )
if format == 'json':
- return simplejson.loads( file( galaxy_repository_list, 'r' ).read() )
+ return from_json_string( listing )
else:
raise AssertonError( 'Unknown format %s.' % format )
+def json_from_url( url ):
+ url_handle = urllib.urlopen( url )
+ url_contents = url_handle.read()
+ return from_json_string( url_contents )
+
+def register_test_failure( url, metadata_id, test_errors ):
+ params = dict( tools_functionally_correct='false', do_not_test='true', tool_test_errors=test_errors )
+ return update( tool_shed_api_key, '%s/api/%s' % ( galaxy_tool_shed_url, '/'.join( [ 'repository_revisions', metadata_id ] ) ), params )
+
+def register_test_success( url, metadata_id ):
+ params = dict( tools_functionally_correct='true', do_not_test='false' )
+ return update( tool_shed_api_key, '%s/api/%s' % ( galaxy_tool_shed_url, '/'.join( [ 'repository_revisions', metadata_id ] ) ), params )
+
def run_tests( test_config ):
loader = nose.loader.TestLoader( config=test_config )
plug_loader = test_config.plugins.prepareTestLoader( loader )
@@ -162,6 +212,7 @@
galaxy_migrated_tool_conf_file = os.environ.get( 'GALAXY_INSTALL_TEST_MIGRATED_TOOL_CONF', os.path.join( galaxy_test_tmp_dir, 'test_migrated_tool_conf.xml' ) )
galaxy_tool_sheds_conf_file = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_SHEDS_CONF', os.path.join( galaxy_test_tmp_dir, 'test_tool_sheds_conf.xml' ) )
galaxy_shed_tools_dict = os.environ.get( 'GALAXY_INSTALL_TEST_SHED_TOOL_DICT_FILE', os.path.join( galaxy_test_tmp_dir, 'shed_tool_dict' ) )
+ file( galaxy_shed_tools_dict, 'w' ).write( to_json_string( dict() ) )
if 'GALAXY_INSTALL_TEST_TOOL_DATA_PATH' in os.environ:
tool_data_path = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_DATA_PATH' )
else:
@@ -302,8 +353,13 @@
log.info( "Tests will be run against %s:%s" % ( galaxy_test_host, galaxy_test_port ) )
success = False
try:
+ repository_status = []
# Iterate through a list of repository info dicts.
- for repository_dict in get_repositories_to_install():
+ for repository_dict in get_repositories_to_install( galaxy_tool_shed_url, source='url' ):
+ metadata_revision_id = repository_dict[ 'id' ]
+ repository_dict[ 'tool_shed_url' ] = galaxy_tool_shed_url
+ repository_info = get_repository_info_from_api( galaxy_tool_shed_url, repository_dict )
+ repository_dict = dict( repository_info.items() + repository_dict.items() )
# Generate the method that will install this repository into the running Galaxy instance.
test_install_repositories.generate_install_method( repository_dict )
os.environ[ 'GALAXY_INSTALL_TEST_HOST' ] = galaxy_test_host
@@ -319,9 +375,12 @@
if success:
log.debug( 'Installation of %s succeeded, running any defined functional tests.' % repository_dict[ 'name' ] )
# Parse the tool panel config to get the test-data path for this repository.
- shed_tools_dict = parse_tool_panel_config( galaxy_shed_tool_conf_file, {} )
+ if not os.path.exists( galaxy_shed_tools_dict ):
+ file( galaxy_shed_tools_dict, 'w' ).write( to_json_string( dict() ) )
+ shed_tools_dict = parse_tool_panel_config( galaxy_shed_tool_conf_file, from_json_string( file( galaxy_shed_tools_dict, 'r' ).read() ) )
+ log.debug( shed_tools_dict )
# Write this to a file, so the functional test framework can find it.
- file( galaxy_shed_tools_dict, 'w' ).write( simplejson.dumps( shed_tools_dict ) )
+ file( galaxy_shed_tools_dict, 'w' ).write( to_json_string( shed_tools_dict ) )
# Set up the environment so that test.functional.test_toolbox can find the Galaxy server we configured in this framework.
os.environ[ 'GALAXY_TOOL_SHED_TEST_FILE' ] = galaxy_shed_tools_dict
os.environ[ 'GALAXY_TEST_HOST' ] = galaxy_test_host
@@ -337,10 +396,52 @@
# Run the configured tests.
result = run_tests( test_config )
success = result.wasSuccessful()
+ repository_dict[ 'functional_tests_passed' ] = success
if success:
+ register_test_success( galaxy_tool_shed_url, metadata_revision_id )
log.debug( 'Repository %s installed and passed functional tests.' % repository_dict[ 'name' ] )
else:
+ # If the functional tests fail, log the output and submit it to the tool shed whence the repository was installed.
+ repository_dict[ 'tool_test_errors' ] = []
+ for failure in result.failures:
+ label = str( failure[0] )
+ log_output = failure[1].replace( '\\n', '\n' )
+ log_output = re.sub( r'control \d+:.+', r'', log_output )
+ log_output = re.sub( r'\n+', r'\n', log_output )
+ appending_to = 'output'
+ tmp_output = {}
+ output = {}
+ for line in log_output.split( '\n' ):
+ if line.startswith( 'Traceback' ):
+ appending_to = 'traceback'
+ elif 'request returned None from get_history' in line:
+ continue
+ elif '>> begin captured logging <<' in line:
+ appending_to = 'logging'
+ continue
+ elif '>> begin captured stdout <<' in line:
+ appending_to = 'stdout'
+ continue
+ elif '>> begin captured stderr <<' in line:
+ appending_to = 'stderr'
+ continue
+ if appending_to not in tmp_output:
+ tmp_output[ appending_to ] = []
+ tmp_output[ appending_to ].append( line )
+ for output_type in tmp_output:
+ output[ output_type ] = '\n'.join( tmp_output[ output_type ] )
+ repository_dict[ 'tool_test_errors' ].append( dict( test=label, output=output ) )
+ register_test_failure( galaxy_tool_shed_url, metadata_revision_id, repository_dict[ 'tool_test_errors' ] )
log.debug( 'Repository %s installed, but did not pass functional tests.' % repository_dict[ 'name' ] )
+ repository_status.append( repository_dict )
+ # Delete the completed tool functional tests from the test_toolbox.__dict__, otherwise nose will find them and try to re-run the
+ # tests after uninstalling the repository.
+ tests_to_delete = []
+ for key in test_toolbox.__dict__:
+ if key.startswith( 'TestForTool_' ):
+ tests_to_delete.append( key )
+ for key in tests_to_delete:
+ del test_toolbox.__dict__[ key ]
# Generate an uninstall method for this repository, so that the next repository has a clean environment for testing.
test_install_repositories.generate_uninstall_method( repository_dict )
# Set up nose to run the generated uninstall method as a functional test.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: inithello: Remove some unneeded data from the repository metadata API collection view.
by commits-noreply@bitbucket.org 27 Feb '13
by commits-noreply@bitbucket.org 27 Feb '13
27 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fabb0ae1edab/
changeset: fabb0ae1edab
user: inithello
date: 2013-02-27 20:23:07
summary: Remove some unneeded data from the repository metadata API collection view.
affected #: 1 file
diff -r b9c7813848e989d1a228a53745bb57f958b05467 -r fabb0ae1edabf77f9aceb018fa5a988ce05500f9 lib/galaxy/webapps/community/model/__init__.py
--- a/lib/galaxy/webapps/community/model/__init__.py
+++ b/lib/galaxy/webapps/community/model/__init__.py
@@ -191,8 +191,7 @@
fp.close()
class RepositoryMetadata( object, APIItem ):
- api_collection_visible_keys = ( 'id', 'repository_id', 'changeset_revision', 'malicious', 'downloadable', 'tools_functionally_correct',
- 'do_not_test', 'time_last_tested', 'tool_test_errors' )
+ api_collection_visible_keys = ( 'id', 'repository_id', 'changeset_revision', 'malicious', 'downloadable' )
api_element_visible_keys = ( 'id', 'repository_id', 'changeset_revision', 'malicious', 'downloadable', 'tools_functionally_correct',
'do_not_test', 'time_last_tested', 'tool_test_errors' )
def __init__( self, id=None, repository_id=None, changeset_revision=None, metadata=None, tool_versions=None, malicious=False, downloadable=False,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: inithello: Attempt to resolve issue with tool shed registry when running buildbot functional tests.
by commits-noreply@bitbucket.org 27 Feb '13
by commits-noreply@bitbucket.org 27 Feb '13
27 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b9c7813848e9/
changeset: b9c7813848e9
user: inithello
date: 2013-02-27 20:12:07
summary: Attempt to resolve issue with tool shed registry when running buildbot functional tests.
affected #: 1 file
diff -r 8bad40b5b8ab0aee26c09ef8d59ca15227e1fec3 -r b9c7813848e989d1a228a53745bb57f958b05467 scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -314,6 +314,7 @@
log.info( "Functional tests will be run against %s:%s" % ( galaxy_test_host, galaxy_test_port ) )
success = False
try:
+ tool_configs = app.config.tool_configs
# What requires these? Handy for (eg) functional tests to save outputs?
if galaxy_test_save:
os.environ[ 'GALAXY_TEST_SAVE' ] = galaxy_test_save
@@ -337,7 +338,6 @@
# Eliminate the migrated_tool_panel_config from the app's tool_configs, append the list of installed_tool_panel_configs,
# and reload the app's toolbox.
relative_migrated_tool_panel_config = os.path.join( app.config.root, migrated_tool_panel_config )
- tool_configs = app.config.tool_configs
if relative_migrated_tool_panel_config in tool_configs:
tool_configs.remove( relative_migrated_tool_panel_config )
for installed_tool_panel_config in installed_tool_panel_configs:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: inithello: Clean up remaining references to galaxy.util.shed_util_common.
by commits-noreply@bitbucket.org 27 Feb '13
by commits-noreply@bitbucket.org 27 Feb '13
27 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8bad40b5b8ab/
changeset: 8bad40b5b8ab
user: inithello
date: 2013-02-27 17:16:10
summary: Clean up remaining references to galaxy.util.shed_util_common.
affected #: 2 files
diff -r b985587c33926d8d38fa4456b51eecbc68953bb9 -r 8bad40b5b8ab0aee26c09ef8d59ca15227e1fec3 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -920,7 +920,7 @@
def tool_shed_repository( self ):
# If this tool is included in an installed tool shed repository, return it.
if self.tool_shed:
- return galaxy.util.shed_util_common.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.app,
+ return tool_shed.util.shed_util_common.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.app,
self.tool_shed,
self.repository_name,
self.repository_owner,
diff -r b985587c33926d8d38fa4456b51eecbc68953bb9 -r 8bad40b5b8ab0aee26c09ef8d59ca15227e1fec3 lib/tool_shed/galaxy_install/__init__.py
--- a/lib/tool_shed/galaxy_install/__init__.py
+++ b/lib/tool_shed/galaxy_install/__init__.py
@@ -28,7 +28,7 @@
ElementInclude.include( root )
tool_path = root.get( 'tool_path', None )
if tool_path:
- tool_shed = galaxy.util.shed_util_common.clean_tool_shed_url( tool_shed_repository.tool_shed )
+ tool_shed = tool_shed.util.shed_util_common.clean_tool_shed_url( tool_shed_repository.tool_shed )
relative_path = os.path.join( tool_path,
tool_shed,
'repos',
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Rename community template path to tool_shed.
by commits-noreply@bitbucket.org 26 Feb '13
by commits-noreply@bitbucket.org 26 Feb '13
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b985587c3392/
changeset: b985587c3392
user: greg
date: 2013-02-26 23:12:52
summary: Rename community template path to tool_shed.
affected #: 101 files
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/web/base/controllers/admin.py
--- a/lib/galaxy/web/base/controllers/admin.py
+++ b/lib/galaxy/web/base/controllers/admin.py
@@ -36,7 +36,7 @@
message=message,
status=status )
else:
- return trans.fill_template( '/webapps/community/admin/index.mako',
+ return trans.fill_template( '/webapps/tool_shed/admin/index.mako',
message=message,
status=status )
@web.expose
@@ -49,7 +49,7 @@
message=message,
status=status )
else:
- return trans.fill_template( '/webapps/community/admin/center.mako',
+ return trans.fill_template( '/webapps/tool_shed/admin/center.mako',
message=message,
status=status )
@web.expose
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py
+++ b/lib/galaxy/web/framework/helpers/grids.py
@@ -454,7 +454,7 @@
""" Column that displays community ratings for an item. """
def get_value( self, trans, grid, item ):
ave_item_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, item, webapp_model=trans.model )
- return trans.fill_template( "community_rating.mako",
+ return trans.fill_template( "tool_shed_rating.mako",
ave_item_rating=ave_item_rating,
num_ratings=num_ratings,
item_id=trans.security.encode_id( item.id ) )
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/community/controllers/admin.py
--- a/lib/galaxy/webapps/community/controllers/admin.py
+++ b/lib/galaxy/webapps/community/controllers/admin.py
@@ -403,7 +403,7 @@
# Grid definition
title = "Repository Metadata"
model_class = model.RepositoryMetadata
- template='/webapps/community/repository/grid.mako'
+ template='/webapps/tool_shed/repository/grid.mako'
default_sort_key = "name"
columns = [
IdColumn( "Id",
@@ -567,7 +567,7 @@
action='manage_categories',
message=message,
status=status ) )
- return trans.fill_template( '/webapps/community/category/create_category.mako',
+ return trans.fill_template( '/webapps/tool_shed/category/create_category.mako',
name=name,
description=description,
message=message,
@@ -667,7 +667,7 @@
action='manage_categories',
message=message,
status=status ) )
- return trans.fill_template( '/webapps/community/category/edit_category.mako',
+ return trans.fill_template( '/webapps/tool_shed/category/edit_category.mako',
category=category,
message=message,
status=status )
@@ -677,7 +677,7 @@
if 'f-free-text-search' in kwd:
# Trick to enable searching repository name, description from the CategoryGrid.
# What we've done is rendered the search box for the RepositoryGrid on the grid.mako
- # template for the CategoryGrid. See ~/templates/webapps/community/category/grid.mako.
+ # template for the CategoryGrid. See ~/templates/webapps/tool_shed/category/grid.mako.
# Since we are searching repositories and not categories, redirect to browse_repositories().
return trans.response.send_redirect( web.url_for( controller='admin',
action='browse_repositories',
@@ -714,7 +714,7 @@
if 'regenerate_statistics_button' in kwd:
trans.app.shed_counter.generate_statistics()
message = "Successfully regenerated statistics"
- return trans.fill_template( '/webapps/community/admin/statistics.mako',
+ return trans.fill_template( '/webapps/tool_shed/admin/statistics.mako',
message=message,
status=status )
@web.expose
@@ -726,7 +726,7 @@
message = util.restore_text( kwd.get( 'message', '' ) )
status = kwd.get( 'status', 'done' )
repositories_select_field = suc.build_repository_ids_select_field( trans )
- return trans.fill_template( '/webapps/community/admin/reset_metadata_on_selected_repositories.mako',
+ return trans.fill_template( '/webapps/tool_shed/admin/reset_metadata_on_selected_repositories.mako',
repositories_select_field=repositories_select_field,
message=message,
status=status )
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -46,7 +46,7 @@
return 0
title = "Categories"
model_class = model.Category
- template='/webapps/community/category/grid.mako'
+ template='/webapps/tool_shed/category/grid.mako'
default_sort_key = "name"
columns = [
NameColumn( "Name",
@@ -82,7 +82,7 @@
return 0
title = "Categories of valid repositories"
model_class = model.Category
- template='/webapps/community/category/valid_grid.mako'
+ template='/webapps/tool_shed/category/valid_grid.mako'
default_sort_key = "name"
columns = [
CategoryGrid.NameColumn( "Name",
@@ -172,7 +172,7 @@
# Grid definition
title = "Repositories"
model_class = model.Repository
- template='/webapps/community/repository/grid.mako'
+ template='/webapps/tool_shed/repository/grid.mako'
default_sort_key = "name"
columns = [
NameColumn( "Name",
@@ -503,7 +503,7 @@
# Grid definition
title = "Matching repositories"
model_class = model.RepositoryMetadata
- template='/webapps/community/repository/grid.mako'
+ template='/webapps/tool_shed/repository/grid.mako'
default_sort_key = "Repository.name"
columns = [
NameColumn( "Repository name",
@@ -571,7 +571,7 @@
# The request came from the tool shed.
if 'f-free-text-search' in kwd:
# Trick to enable searching repository name, description from the CategoryGrid. What we've done is rendered the search box for the
- # RepositoryGrid on the grid.mako template for the CategoryGrid. See ~/templates/webapps/community/category/grid.mako. Since we
+ # RepositoryGrid on the grid.mako template for the CategoryGrid. See ~/templates/webapps/tool_shed/category/grid.mako. Since we
# are searching repositories and not categories, redirect to browse_repositories().
if 'id' in kwd and 'f-free-text-search' in kwd and kwd[ 'id' ] == kwd[ 'f-free-text-search' ]:
# The value of 'id' has been set to the search string, which is a repository name. We'll try to get the desired encoded repository
@@ -629,7 +629,7 @@
repository.name,
repository.user.username,
downloadable_revision.changeset_revision )
- return trans.fill_template( '/webapps/community/repository/browse_invalid_tools.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/browse_invalid_tools.mako',
cntrller=cntrller,
invalid_tools_dict=invalid_tools_dict,
message=message,
@@ -747,7 +747,7 @@
suc.update_repository( repo )
is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
- return trans.fill_template( '/webapps/community/repository/browse_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repository=repository,
metadata=metadata,
commit_message=commit_message,
@@ -937,7 +937,7 @@
repository = suc.get_repository_in_tool_shed( trans, id )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
if trans.user and trans.user.email:
- return trans.fill_template( "/webapps/community/repository/contact_owner.mako",
+ return trans.fill_template( "/webapps/tool_shed/repository/contact_owner.mako",
repository=repository,
metadata=metadata,
message=message,
@@ -1032,7 +1032,7 @@
action='view_repository',
message=message,
id=trans.security.encode_id( repository.id ) ) )
- return trans.fill_template( '/webapps/community/repository/create_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/create_repository.mako',
name=name,
description=description,
long_description=long_description,
@@ -1073,7 +1073,7 @@
is_malicious = suc.changeset_is_malicious( trans, repository_id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, repository_id, changeset_revision )
try:
- return trans.fill_template( "/webapps/community/repository/tool_form.mako",
+ return trans.fill_template( "/webapps/tool_shed/repository/tool_form.mako",
repository=repository,
metadata=metadata,
changeset_revision=changeset_revision,
@@ -1197,7 +1197,7 @@
message = "No search performed - each field must contain the same number of comma-separated items."
status = "error"
exact_matches_check_box = CheckboxField( 'exact_matches', checked=exact_matches_checked )
- return trans.fill_template( '/webapps/community/repository/find_tools.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/find_tools.mako',
tool_id=self.__stringify( tool_ids ),
tool_name=self.__stringify( tool_names ),
tool_version=self.__stringify( tool_versions ),
@@ -1286,7 +1286,7 @@
exact_matches_checked = False
workflow_names = []
exact_matches_check_box = CheckboxField( 'exact_matches', checked=exact_matches_checked )
- return trans.fill_template( '/webapps/community/repository/find_workflows.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/find_workflows.mako',
workflow_name=self.__stringify( workflow_names ),
exact_matches_check_box=exact_matches_check_box,
message=message,
@@ -1690,7 +1690,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- return trans.fill_template( '/webapps/community/repository/help.mako', message=message, status=status, **kwd )
+ return trans.fill_template( '/webapps/tool_shed/repository/help.mako', message=message, status=status, **kwd )
def __in_tool_dict( self, tool_dict, exact_matches_checked, tool_id=None, tool_name=None, tool_version=None ):
found = False
if tool_id and not tool_name and not tool_version:
@@ -1762,7 +1762,7 @@
user_id = params.get( 'user_id', None )
repository_id = params.get( 'repository_id', None )
changeset_revision = params.get( 'changeset_revision', None )
- return trans.fill_template( '/webapps/community/index.mako',
+ return trans.fill_template( '/webapps/tool_shed/index.mako',
repository_metadata=repository_metadata,
has_reviewed_repositories=has_reviewed_repositories,
has_deprecated_repositories=has_deprecated_repositories,
@@ -1813,7 +1813,7 @@
elif error_message:
message = error_message
try:
- return trans.fill_template( "/webapps/community/repository/tool_form.mako",
+ return trans.fill_template( "/webapps/tool_shed/repository/tool_form.mako",
repository=repository,
changeset_revision=changeset_revision,
tool=tool,
@@ -1872,7 +1872,7 @@
.order_by( trans.model.Repository.table.c.name ):
if user.email in repository.email_alerts:
email_alert_repositories.append( repository )
- return trans.fill_template( "/webapps/community/user/manage_email_alerts.mako",
+ return trans.fill_template( "/webapps/tool_shed/user/manage_email_alerts.mako",
new_repo_alert_check_box=new_repo_alert_check_box,
email_alert_repositories=email_alert_repositories,
message=message,
@@ -2056,7 +2056,7 @@
review_id = None
can_browse_repository_reviews = suc.can_browse_repository_reviews( trans, repository )
containers_dict = suc.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
- return trans.fill_template( '/webapps/community/repository/manage_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/manage_repository.mako',
repo_name=repo_name,
description=description,
long_description=long_description,
@@ -2163,7 +2163,7 @@
add_id_to_name=False,
downloadable=False )
containers_dict = suc.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
- return trans.fill_template( '/webapps/community/repository/preview_tools_in_changeset.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/preview_tools_in_changeset.mako',
repository=repository,
containers_dict=containers_dict,
repository_metadata_id=repository_metadata_id,
@@ -2230,7 +2230,7 @@
rra = self.get_user_item_rating( trans.sa_session, trans.user, repository, webapp_model=trans.model )
is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
- return trans.fill_template( '/webapps/community/repository/rate_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
metadata=metadata,
avg_rating=avg_rating,
@@ -2242,7 +2242,7 @@
status=status )
@web.expose
def reset_all_metadata( self, trans, id, **kwd ):
- # This method is called only from the ~/templates/webapps/community/repository/manage_repository.mako template.
+ # This method is called only from the ~/templates/webapps/tool_shed/repository/manage_repository.mako template.
# It resets all metadata on the complete changelog for a single repository in the tool shed.
invalid_file_tups, metadata_dict = suc.reset_all_metadata_on_repository_in_tool_shed( trans, id, **kwd )
if invalid_file_tups:
@@ -2405,7 +2405,7 @@
message = "Select at least 1 file to delete from the repository before clicking <b>Delete selected files</b>."
status = "error"
is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
- return trans.fill_template( '/webapps/community/repository/browse_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/browse_repository.mako',
repo=repo,
repository=repository,
commit_message=commit_message,
@@ -2672,7 +2672,7 @@
changesets.insert( 0, change_dict )
is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, repository.tip( trans.app ) )
- return trans.fill_template( '/webapps/community/repository/view_changelog.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/view_changelog.mako',
repository=repository,
metadata=metadata,
changesets=changesets,
@@ -2703,7 +2703,7 @@
diffs.append( suc.to_safe_string( diff, to_html=True ) )
is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) )
metadata = self.get_metadata( trans, id, ctx_str )
- return trans.fill_template( '/webapps/community/repository/view_changeset.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/view_changeset.mako',
repository=repository,
metadata=metadata,
ctx=ctx,
@@ -2810,7 +2810,7 @@
review_id = None
containers_dict = suc.build_repository_containers_for_tool_shed( trans, repository, changeset_revision, repository_dependencies, repository_metadata )
can_browse_repository_reviews = suc.can_browse_repository_reviews( trans, repository )
- return trans.fill_template( '/webapps/community/repository/view_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako',
repo=repo,
repository=repository,
repository_metadata_id=repository_metadata_id,
@@ -2893,7 +2893,7 @@
review_id = trans.security.encode_id( review.id )
else:
review_id = None
- return trans.fill_template( "/webapps/community/repository/view_tool_metadata.mako",
+ return trans.fill_template( "/webapps/tool_shed/repository/view_tool_metadata.mako",
repository=repository,
metadata=metadata,
tool=tool,
@@ -2919,7 +2919,7 @@
repository = suc.get_repository_in_tool_shed( trans, trans.security.encode_id( repository_metadata.repository_id ) )
changeset_revision = repository_metadata.changeset_revision
metadata = repository_metadata.metadata
- return trans.fill_template( "/webapps/community/repository/view_workflow.mako",
+ return trans.fill_template( "/webapps/tool_shed/repository/view_workflow.mako",
repository=repository,
changeset_revision=changeset_revision,
repository_metadata_id=repository_metadata_id,
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/community/controllers/repository_review.py
--- a/lib/galaxy/webapps/community/controllers/repository_review.py
+++ b/lib/galaxy/webapps/community/controllers/repository_review.py
@@ -27,7 +27,7 @@
return component.description
title = "Repository review components"
model_class = model.Component
- template='/webapps/community/repository_review/grid.mako'
+ template='/webapps/tool_shed/repository_review/grid.mako'
default_sort_key = "name"
columns = [
NameColumn( "Name",
@@ -89,7 +89,7 @@
return rval
title = "All reviewed repositories"
model_class = model.Repository
- template='/webapps/community/repository_review/grid.mako'
+ template='/webapps/tool_shed/repository_review/grid.mako'
default_sort_key = "Repository.name"
columns = [
RepositoryGrid.NameColumn( "Repository name",
@@ -196,7 +196,7 @@
return ''
title = "Reviews by user"
model_class = model.RepositoryReview
- template='/webapps/community/repository_review/grid.mako'
+ template='/webapps/tool_shed/repository_review/grid.mako'
default_sort_key = 'repository_id'
columns = [
RepositoryNameColumn( "Repository Name",
@@ -316,7 +316,7 @@
repository = review.repository
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
- return trans.fill_template( '/webapps/community/repository_review/browse_review.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/browse_review.mako',
repository=repository,
changeset_revision_label=changeset_revision_label,
review=review,
@@ -361,7 +361,7 @@
action='manage_components',
message=message,
status=status ) )
- return trans.fill_template( '/webapps/community/repository_review/create_component.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/create_component.mako',
name=name,
description=description,
message=message,
@@ -456,7 +456,7 @@
action='manage_components',
message=message,
status=status ) )
- return trans.fill_template( '/webapps/community/repository_review/edit_component.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/edit_component.mako',
component=component,
message=message,
status=status )
@@ -576,7 +576,7 @@
selected_value=selected_value,
for_component=False )
rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
- return trans.fill_template( '/webapps/community/repository_review/edit_review.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/edit_review.mako',
repository=repository,
review=review,
changeset_revision_label=changeset_revision_label,
@@ -688,7 +688,7 @@
installable=installable,
can_add_review=can_add_review )
reviews_dict[ changeset_revision ] = revision_dict
- return trans.fill_template( '/webapps/community/repository_review/reviews_of_repository.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/reviews_of_repository.mako',
repository=repository,
reviews_dict=reviews_dict,
mine=mine,
@@ -709,7 +709,7 @@
installable = changeset_revision in [ metadata_revision.changeset_revision for metadata_revision in repository.metadata_revisions ]
rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
reviews = suc.get_reviews_by_repository_id_changeset_revision( trans, repository_id, changeset_revision )
- return trans.fill_template( '/webapps/community/repository_review/reviews_of_changeset_revision.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako',
repository=repository,
changeset_revision=changeset_revision,
changeset_revision_label=changeset_revision_label,
@@ -773,7 +773,7 @@
repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
previous_reviews_dict = suc.get_previous_repository_reviews( trans, repository, changeset_revision )
rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
- return trans.fill_template( '/webapps/community/repository_review/select_previous_review.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository_review/select_previous_review.mako',
repository=repository,
changeset_revision=changeset_revision,
changeset_revision_label=changeset_revision_label,
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -204,7 +204,7 @@
# Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
suc.reset_tool_data_tables( trans.app )
selected_categories = [ trans.security.decode_id( id ) for id in category_ids ]
- return trans.fill_template( '/webapps/community/repository/upload.mako',
+ return trans.fill_template( '/webapps/tool_shed/repository/upload.mako',
repository=repository,
url=url,
commit_message=commit_message,
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/galaxy/controllers/admin.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin.py
@@ -733,7 +733,7 @@
status = util.restore_text( kwd.get( 'status', 'done' ) )
migration_stages_dict = odict()
migration_modules = []
- migration_scripts_dir = os.path.abspath( os.path.join( trans.app.config.root, 'lib', 'galaxy', 'tool_shed', 'migrate', 'versions' ) )
+ migration_scripts_dir = os.path.abspath( os.path.join( trans.app.config.root, 'lib', 'tool_shed', 'galaxy_install', 'migrate', 'versions' ) )
migration_scripts_dir_contents = os.listdir( migration_scripts_dir )
for item in migration_scripts_dir_contents:
if os.path.isfile( os.path.join( migration_scripts_dir, item ) ) and item.endswith( '.py' ):
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -735,7 +735,7 @@
message=message,
status=status )
else:
- return trans.fill_template( '/webapps/community/user/manage_info.mako',
+ return trans.fill_template( '/webapps/tool_shed/user/manage_info.mako',
cntrller=cntrller,
user=user,
email=email,
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/common.mako
--- a/templates/admin/tool_shed_repository/common.mako
+++ b/templates/admin/tool_shed_repository/common.mako
@@ -1,4 +1,4 @@
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%def name="browse_files(title_text, directory_path)"><script type="text/javascript">
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/manage_repository.mako
--- a/templates/admin/tool_shed_repository/manage_repository.mako
+++ b/templates/admin/tool_shed_repository/manage_repository.mako
@@ -1,6 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%namespace file="/admin/tool_shed_repository/common.mako" import="*" /><%def name="stylesheets()">
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_dependencies_section" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_readme_section" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%def name="stylesheets()">
${parent.stylesheets()}
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/reset_metadata_on_selected_repositories.mako
--- a/templates/admin/tool_shed_repository/reset_metadata_on_selected_repositories.mako
+++ b/templates/admin/tool_shed_repository/reset_metadata_on_selected_repositories.mako
@@ -1,6 +1,6 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/community/common/common.mako" import="common_misc_javascripts" />
+<%namespace file="/webapps/tool_shed/common/common.mako" import="common_misc_javascripts" /><%def name="javascripts()">
${parent.javascripts()}
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
--- a/templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
+++ b/templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_dependencies_section" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_readme_section" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%def name="stylesheets()">
${parent.stylesheets()}
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/select_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_dependencies_section" /><%namespace file="/admin/tool_shed_repository/common.mako" import="render_readme_section" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%def name="stylesheets()">
${parent.stylesheets()}
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/admin/tool_shed_repository/view_workflow.mako
--- a/templates/admin/tool_shed_repository/view_workflow.mako
+++ b/templates/admin/tool_shed_repository/view_workflow.mako
@@ -1,7 +1,7 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/community/common/common.mako" import="*" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/common/common.mako" import="*" />
+<%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%
from galaxy.web.framework.helpers import time_ago
@@ -11,7 +11,7 @@
<%!
def inherit(context):
if context.get('use_panels'):
- return '/webapps/community/base_panels.mako'
+ return '/webapps/tool_shed/base_panels.mako'
else:
return '/base.mako'
%>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/community_rating.mako
--- a/templates/community_rating.mako
+++ /dev/null
@@ -1,33 +0,0 @@
-<%
- label = "ratings"
- if num_ratings == 1:
- label = "rating"
-%>
-<div>
- <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="1"
- %if ave_item_rating > 0 and ave_item_rating <= 1.5:
- checked="checked"
- %endif
-
- />
- <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="2"
- %if ave_item_rating > 1.5 and ave_item_rating <= 2.5:
- checked="checked"
- %endif
- />
- <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="3"
- %if ave_item_rating > 2.5 and ave_item_rating <= 3.5:
- checked="checked"
- %endif
- />
- <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="4"
- %if ave_item_rating > 3.5 and ave_item_rating <= 4.5:
- checked="checked"
- %endif
- />
- <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="5"
- %if ave_item_rating > 4.5:
- checked="checked"
- %endif
- />
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/tool_shed_rating.mako
--- /dev/null
+++ b/templates/tool_shed_rating.mako
@@ -0,0 +1,33 @@
+<%
+ label = "ratings"
+ if num_ratings == 1:
+ label = "rating"
+%>
+<div>
+ <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="1"
+ %if ave_item_rating > 0 and ave_item_rating <= 1.5:
+ checked="checked"
+ %endif
+
+ />
+ <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="2"
+ %if ave_item_rating > 1.5 and ave_item_rating <= 2.5:
+ checked="checked"
+ %endif
+ />
+ <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="3"
+ %if ave_item_rating > 2.5 and ave_item_rating <= 3.5:
+ checked="checked"
+ %endif
+ />
+ <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="4"
+ %if ave_item_rating > 3.5 and ave_item_rating <= 4.5:
+ checked="checked"
+ %endif
+ />
+ <input name="star1-${item_id}" type="radio" class="community_rating_star star" disabled="disabled" value="5"
+ %if ave_item_rating > 4.5:
+ checked="checked"
+ %endif
+ />
+</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/user/dbkeys.mako
--- a/templates/user/dbkeys.mako
+++ b/templates/user/dbkeys.mako
@@ -1,7 +1,7 @@
<%!
def inherit(context):
if context.get('use_panels'):
- return '/base_panels.mako'
+ return '/webapps/galaxy/base_panels.mako'
else:
return '/base.mako'
%>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/user/login.mako
--- a/templates/user/login.mako
+++ b/templates/user/login.mako
@@ -1,7 +1,7 @@
<%!
def inherit(context):
if context.get('use_panels'):
- return '/base_panels.mako'
+ return '/webapps/galaxy/base_panels.mako'
else:
return '/base.mako'
%>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/user/logout.mako
--- a/templates/user/logout.mako
+++ b/templates/user/logout.mako
@@ -1,4 +1,4 @@
-<%inherit file="/base_panels.mako"/>
+<%inherit file="/webapps/galaxy/base_panels.mako"/><%namespace file="/message.mako" import="render_msg" />
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/user/openid_associate.mako
--- a/templates/user/openid_associate.mako
+++ b/templates/user/openid_associate.mako
@@ -1,7 +1,7 @@
<%!
def inherit(context):
if context.get('use_panels'):
- return '/base_panels.mako'
+ return '/webapps/galaxy/base_panels.mako'
else:
return '/base.mako'
%>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/admin/center.mako
--- a/templates/webapps/community/admin/center.mako
+++ /dev/null
@@ -1,50 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-
-<%def name="title()">Galaxy Administration</%def>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<h2>Administration</h2>
-
-<p>The menu on the left provides the following features</p>
-<ul>
- <li>
- <strong>Categories</strong>
- <p/>
- <ul>
- <li>
- <strong>Manage categories</strong>
- </li>
- <p/>
- </ul>
- </li>
- <li>
- <strong>Security</strong>
- <p/>
- <ul>
- <li>
- <strong>Manage users</strong> - provides a view of the registered users and all groups and non-private roles associated
- with each user.
- </li>
- <p/>
- <li>
- <strong>Manage groups</strong> - provides a view of all groups along with the members of the group and the roles associated with
- each group (both private and non-private roles). The group names include a link to a page that allows you to manage the users and
- roles that are associated with the group.
- </li>
- <p/>
- <li>
- <strong>Manage roles</strong> - provides a view of all non-private roles along with the role type, and the users and groups that
- are associated with the role. The role names include a link to a page that allows you to manage the users and groups that are associated
- with the role. The page also includes a view of the data library datasets that are associated with the role and the permissions applied
- to each dataset.
- </li>
- </ul>
- </li>
- <p/>
-</ul>
-<br/>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/admin/index.mako
--- a/templates/webapps/community/admin/index.mako
+++ /dev/null
@@ -1,139 +0,0 @@
-<%inherit file="/webapps/community/base_panels.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="stylesheets()">
- ## Include "base.css" for styling tool menu and forms (details)
- ${h.css( "base", "autocomplete_tagging", "tool_menu" )}
-
- ## But make sure styles for the layout take precedence
- ${parent.stylesheets()}
-
- <style type="text/css">
- body { margin: 0; padding: 0; overflow: hidden; }
- #left {
- background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-</%def>
-
-<%def name="init()">
- <%
- self.has_left_panel=True
- self.has_right_panel=False
- self.active_view="tools"
- %>
- %if trans.app.config.require_login and not trans.user:
- <script type="text/javascript">
- if ( window != top ) {
- top.location.href = location.href;
- }
- </script>
- %endif
-</%def>
-
-<%def name="left_panel()">
- <% can_review_repositories = trans.app.security_agent.user_can_review_repositories( trans.user ) %>
- <div class="unified-panel-header" unselectable="on">
- <div class='unified-panel-header-inner'>Administration</div>
- </div>
- <div class="page-container" style="padding: 10px;">
- <div class="toolMenu">
- <div class="toolSectionList">
- <div class="toolSectionTitle">
- Repositories
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_categories' )}">Browse by category</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='browse_repositories' )}">Browse all repositories</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='reset_metadata_on_selected_repositories_in_tool_shed' )}">Reset selected metadata</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='browse_repository_metadata' )}">Browse metadata</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_invalid_tools', cntrller='admin' )}">Browse invalid tools</a>
- </div>
- </div>
- </div>
- %if can_review_repositories:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Reviewing Repositories
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- %if trans.user.repository_reviews:
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_reviewed_by_me' )}">Repositories reviewed by me</a>
- </div>
- %endif
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_reviews' )}">All reviewed repositories</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">Repositories with no reviews</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_components' )}">Manage review components</a>
- </div>
- </div>
- </div>
- %endif
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Categories
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='manage_categories' )}">Manage categories</a>
- </div>
- </div>
- </div>
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Security
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='users' )}">Manage users</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='groups' )}">Manage groups</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='roles' )}">Manage roles</a>
- </div>
- </div>
- </div>
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Statistics
- </div>
- <div class="toolSectionBody">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='admin', action='regenerate_statistics' )}">View shed statistics</a>
- </div>
- </div>
- </div>
- </div>
- </div>
-</%def>
-
-<%def name="center_panel()">
- <%
- center_url = h.url_for(controller='admin', action='center' )
- %>
- <iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/admin/reset_metadata_on_selected_repositories.mako
--- a/templates/webapps/community/admin/reset_metadata_on_selected_repositories.mako
+++ /dev/null
@@ -1,40 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/community/common/common.mako" import="common_misc_javascripts" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${common_misc_javascripts()}
-</%def>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="warningmessage">
- Resetting metadata may take a while because this process clones each change set in each selected repository's change log to a temporary location on disk.
- Wait until this page redirects after clicking the <b>Reset metadata on selected repositories</b> button, as doing anything else will not be helpful. Watch
- the tool shed paster log to pass the time if necessary.
-</div>
-
-<div class="toolForm">
- <div class="toolFormTitle">Reset all metadata on each selected repository</div>
- <form name="reset_metadata_on_selected_repositories" id="reset_metadata_on_selected_repositories" action="${h.url_for( controller='admin', action='reset_metadata_on_selected_repositories_in_tool_shed' )}" method="post" >
- <div class="form-row">
- Check each repository for which you want to reset metadata. Repository names are followed by owners in parentheses.
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <input type="checkbox" id="checkAll" name="select_all_repositories_checkbox" value="true" onclick="checkAllFields('repository_ids');"/><input type="hidden" name="select_all_repositories_checkbox" value="true"/><b>Select/unselect all repositories</b>
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- ${repositories_select_field.get_html()}
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <input type="submit" name="reset_metadata_on_selected_repositories_button" value="Reset metadata on selected repositories"/>
- </div>
- </form>
- </div>
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/admin/statistics.mako
--- a/templates/webapps/community/admin/statistics.mako
+++ /dev/null
@@ -1,56 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Tool shed statistics generated on ${trans.app.shed_counter.generation_time}</div>
- <form name="regenerate_statistics" id="regenerate_statistics" action="${h.url_for( controller='admin', action='regenerate_statistics' )}" method="post" >
- <div class="form-row">
- <table class="grid">
- <tr>
- <th>Item</th>
- <th>Count</th>
- </tr>
- <tr>
- <td>Total repositories</td>
- <td>${trans.app.shed_counter.repositories | h}</td>
- </tr>
- ##<tr>
- ## <td>Empty repositories</td>
- ## <td>${trans.app.shed_counter.new_repositories | h}</td>
- ##</tr>
- <tr>
- <td>Deleted repositories</td>
- <td>${trans.app.shed_counter.deleted_repositories | h}</td>
- </tr>
- <tr>
- <td>Valid tools</td>
- <td>${trans.app.shed_counter.valid_tools | h}</td>
- </tr>
- <tr>
- <td>Invalid tools</td>
- <td>${trans.app.shed_counter.invalid_tools | h}</td>
- </tr>
- <tr>
- <td>Workflows</td>
- <td>${trans.app.shed_counter.workflows | h}</td>
- </tr>
- <tr>
- <td>Proprietary datatypes</td>
- <td>${trans.app.shed_counter.proprietary_datatypes | h}</td>
- </tr>
- <tr>
- <td>Total clones</td>
- <td>${trans.app.shed_counter.total_clones | h}</td>
- </tr>
- </table>
- </div>
- <div class="form-row">
- <input type="submit" name="regenerate_statistics_button" value="Regenerate statistics"/>
- </div>
- </form>
- </div>
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/base_panels.mako
--- a/templates/webapps/community/base_panels.mako
+++ /dev/null
@@ -1,133 +0,0 @@
-<%inherit file="/base/base_panels.mako"/>
-
-## Default title
-<%def name="title()">Galaxy Tool Shed</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-</%def>
-
-## Masthead
-<%def name="masthead()">
-
- ## Tab area, fills entire width
- <div style="position: relative; right: -50%; float: left;">
- <div style="display: block; position: relative; right: 50%;">
-
- <ul class="nav" border="0" cellspacing="0">
-
- <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='', menu_options=None )">
- <%
- cls = ""
- a_cls = ""
- extra = ""
- if extra_class:
- cls += " " + extra_class
- if self.active_view == id:
- cls += " active"
- if menu_options:
- cls += " dropdown"
- a_cls += " dropdown-toggle"
- extra = "<b class='caret'></b>"
- style = ""
- if not visible:
- style = "display: none;"
- %>
- <li class="${cls}" style="${style}">
- %if href:
- <a class="${a_cls}" data-toggle="dropdown" target="${target}" href="${href}">${display}${extra}</a>
- %else:
- <a class="${a_cls}" data-toggle="dropdown">${display}${extra}</a>
- %endif
- %if menu_options:
- <ul class="dropdown-menu">
- %for menu_item in menu_options:
- %if not menu_item:
- <li class="divider"></li>
- %else:
- <li>
- %if len ( menu_item ) == 1:
- ${menu_item[0]}
- %elif len ( menu_item ) == 2:
- <% name, link = menu_item %>
- <a href="${link}">${name | h}</a>
- %else:
- <% name, link, target = menu_item %>
- <a target="${target}" href="${link}">${name | h}</a>
- %endif
- </li>
- %endif
- %endfor
- </ul>
- %endif
- </li>
- </%def>
-
- ## Repositories tab.
- ${tab( "repositories", "Repositories", h.url_for( controller='/repository', action='index' ) )}
-
- ## Admin tab.
- ${tab( "admin", "Admin", h.url_for( controller='/admin', action='index' ), extra_class="admin-only", visible=( trans.user and app.config.is_admin_user( trans.user ) ) )}
-
- ## Help tab.
- <%
- menu_options = []
- qa_url = app.config.get( "qa_url", None )
- if qa_url:
- menu_options = [ [_('Galaxy Q&A'), qa_url, "_blank" ] ]
- menu_options.extend( [
- [_('Support'), app.config.get( "support_url", "http://wiki.g2.bx.psu.edu/Support" ), "_blank" ],
- [_('Tool shed wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/Tool%20Shed" ), "_blank" ],
- [_('Galaxy wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/" ), "_blank" ],
- [_('Video tutorials (screencasts)'), app.config.get( "screencasts_url", "http://galaxycast.org" ), "_blank" ],
- [_('How to Cite Galaxy'), app.config.get( "citation_url", "http://wiki.g2.bx.psu.edu/Citing%20Galaxy" ), "_blank" ]
- ] )
- tab( "help", _("Help"), None, menu_options=menu_options )
- %>
-
- ## User tabs.
- <%
- # Menu for user who is not logged in.
- menu_options = [ [ _("Login"), h.url_for( controller='/user', action='login' ), "galaxy_main" ] ]
- if app.config.allow_user_creation:
- menu_options.append( [ _("Register"), h.url_for( controller='/user', action='create', cntrller='user' ), "galaxy_main" ] )
- extra_class = "loggedout-only"
- visible = ( trans.user == None )
- tab( "user", _("User"), None, visible=visible, menu_options=menu_options )
- # Menu for user who is logged in.
- if trans.user:
- email = trans.user.email
- else:
- email = ""
- menu_options = [ [ '<a>Logged in as <span id="user-email">%s</span></a>' % email ] ]
- if app.config.use_remote_user:
- if app.config.remote_user_logout_href:
- menu_options.append( [ _('Logout'), app.config.remote_user_logout_href, "_top" ] )
- else:
- menu_options.append( [ _('Preferences'), h.url_for( controller='/user', action='index', cntrller='user' ), "galaxy_main" ] )
- menu_options.append( [ _('API Keys'), h.url_for( controller='/user', action='api_keys', cntrller='user' ), "galaxy_main" ] )
- logout_url = h.url_for( controller='/user', action='logout' )
- menu_options.append( [ 'Logout', logout_url, "_top" ] )
- menu_options.append( None )
- if app.config.use_remote_user:
- menu_options.append( [ _('Public Name'), h.url_for( controller='/user', action='edit_username', cntrller='user' ), "galaxy_main" ] )
-
- extra_class = "loggedin-only"
- visible = ( trans.user != None )
- tab( "user", "User", None, visible=visible, menu_options=menu_options )
- %>
- </ul>
- </div>
- </div>
-
- ## Logo, layered over tabs to be clickable
- <div class="title">
- <a href="${h.url_for( app.config.get( 'logo_url', '/' ) )}">
- <img border="0" src="${h.url_for('/static/images/galaxyIcon_noText.png')}">
- Galaxy Tool Shed
- %if app.config.brand:
- <span>/ ${app.config.brand}</span>
- %endif
- </a>
- </div>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/category/create_category.mako
--- a/templates/webapps/community/category/create_category.mako
+++ /dev/null
@@ -1,34 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
- $("input:text:first").focus();
- })
- </script>
-</%def>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Create Category</div>
- <div class="toolFormBody">
- <form name="create_category_form" id="create_category_form" action="${h.url_for(controller='admin', action='create_category' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <input name="name" type="textfield" value="${name | h}" size=40"/>
- </div>
- <div class="form-row">
- <label>Description:</label>
- <input name="description" type="textfield" value="${description | h}" size=40"/>
- </div>
- <div class="form-row">
- <input type="submit" name="create_category_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/category/edit_category.mako
--- a/templates/webapps/community/category/edit_category.mako
+++ /dev/null
@@ -1,43 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Change category name and description</div>
- <div class="toolFormBody">
- <form name="edit_category" action="${h.url_for( controller='admin', action='edit_category' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="${category.name | h}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Description:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input name="description" type="textfield" value="${category.description | h}" size=40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="rename" value="submitted"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="id" value="${trans.security.encode_id( category.id )}"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="edit_category_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/category/grid.mako
--- a/templates/webapps/community/category/grid.mako
+++ /dev/null
@@ -1,64 +0,0 @@
-<%namespace file="/display_common.mako" import="render_message" />
-<%namespace file="/grid_base.mako" import="*" />
-<%namespace file="/grid_common.mako" import="*" />
-<%inherit file="/grid_base.mako" />
-
-## Render grid header.
-## TODO: This is very similar to this directory's valid_grid.mako, so see if we can re-use this code in a better way.
-<%def name="render_grid_header( grid, repo_grid, render_title=True)">
- <div class="grid-header">
- %if render_title:
- ${grid_title()}
- %endif
- %if grid.global_actions:
- <ul class="manage-table-actions">
- %if len( grid.global_actions ) < 4:
- %for action in grid.global_actions:
- <li><a class="action-button" href="${h.url_for( **action.url_args )}">${action.label | h}</a></li>
- %endfor
- %else:
- <li><a class="action-button" id="action-8675309-popup" class="menubutton">Actions</a></li>
- <div popupmenu="action-8675309-popup">
- %for action in grid.global_actions:
- <a class="action-button" href="${h.url_for( **action.url_args )}">${action.label | h}</a>
- %endfor
- </div>
- %endif
- </ul>
- %endif
- ${render_grid_filters( repo_grid, render_advanced_search=False )}
- </div>
-</%def>
-
-<%def name="make_grid( grid, repo_grid )">
- <div class="loading-elt-overlay"></div>
- <table>
- <tr>
- <td width="75%">${self.render_grid_header( grid, repo_grid )}</td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td width="100%" id="grid-message" valign="top">${render_message( message, status )}</td>
- <td></td>
- <td></td>
- </tr>
- </table>
- ${render_grid_table( grid, show_item_checkboxes )}
-</%def>
-
-<%def name="grid_body( grid )">
- <%
- from galaxy.webapps.community.controllers.repository import RepositoryGrid
- repo_grid = RepositoryGrid()
- %>
- ${self.make_grid( grid, repo_grid )}
-</%def>
-
-<%def name="center_panel()">
- <div style="overflow: auto; height: 100%">
- <div class="page-container" style="padding: 10px;">
- ${self.grid_body( grid )}
- </div>
- </div>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/category/valid_grid.mako
--- a/templates/webapps/community/category/valid_grid.mako
+++ /dev/null
@@ -1,63 +0,0 @@
-<%namespace file="/display_common.mako" import="render_message" />
-<%namespace file="/grid_base.mako" import="*" />
-<%namespace file="/grid_common.mako" import="*" />
-<%inherit file="/grid_base.mako" />
-
-## Render grid header.
-<%def name="render_grid_header( grid, repo_grid, render_title=True)">
- <div class="grid-header">
- %if render_title:
- ${grid_title()}
- %endif
- %if grid.global_actions:
- <ul class="manage-table-actions">
- %if len( grid.global_actions ) < 4:
- %for action in grid.global_actions:
- <li><a class="action-button" href="${h.url_for( **action.url_args )}">${action.label | h}</a></li>
- %endfor
- %else:
- <li><a class="action-button" id="action-8675309-popup" class="menubutton">Actions</a></li>
- <div popupmenu="action-8675309-popup">
- %for action in grid.global_actions:
- <a class="action-button" href="${h.url_for( **action.url_args )}">${action.label | h}</a>
- %endfor
- </div>
- %endif
- </ul>
- %endif
- ${render_grid_filters( repo_grid, render_advanced_search=False )}
- </div>
-</%def>
-
-<%def name="make_grid( grid, repo_grid )">
- <div class="loading-elt-overlay"></div>
- <table>
- <tr>
- <td width="75%">${self.render_grid_header( grid, repo_grid )}</td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td width="100%" id="grid-message" valign="top">${render_message( message, status )}</td>
- <td></td>
- <td></td>
- </tr>
- </table>
- ${render_grid_table( grid, show_item_checkboxes )}
-</%def>
-
-<%def name="grid_body( grid )">
- <%
- from galaxy.webapps.community.controllers.repository import ValidRepositoryGrid
- repo_grid = ValidRepositoryGrid()
- %>
- ${self.make_grid( grid, repo_grid )}
-</%def>
-
-<%def name="center_panel()">
- <div style="overflow: auto; height: 100%">
- <div class="page-container" style="padding: 10px;">
- ${self.grid_body( grid )}
- </div>
- </div>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/common/common.mako
--- a/templates/webapps/community/common/common.mako
+++ /dev/null
@@ -1,84 +0,0 @@
-<%def name="common_misc_javascripts()">
- <script type="text/javascript">
- function checkAllFields( name )
- {
- var chkAll = document.getElementById( 'checkAll' );
- var checks = document.getElementsByTagName( 'input' );
- var boxLength = checks.length;
- var allChecked = false;
- var totalChecked = 0;
- if ( chkAll.checked == true )
- {
- for ( i=0; i < boxLength; i++ )
- {
- if ( checks[i].name.indexOf( name ) != -1 )
- {
- checks[i].checked = true;
- }
- }
- }
- else
- {
- for ( i=0; i < boxLength; i++ )
- {
- if ( checks[i].name.indexOf( name ) != -1 )
- {
- checks[i].checked = false
- }
- }
- }
- }
- </script>
-</%def>
-
-<%def name="render_star_rating( name, rating, disabled=False )">
- <%
- if disabled:
- disabled_str = ' disabled="disabled"'
- else:
- disabled_str = ''
- html = ''
- for index in range( 1, 6 ):
- html += '<input name="%s" type="radio" class="star" value="%s" %s' % ( str( name ), str( index ), disabled_str )
- if rating > ( index - 0.5 ) and rating < ( index + 0.5 ):
- html += ' checked="checked"'
- html += '/>'
- %>
- ${html}
-</%def>
-
-<%def name="render_long_description( description_text )">
- <style type="text/css">
- #description_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style>
- <div class="form-row">
- <label>Detailed description:</label>
- <table id="description_table">
- <tr><td>${description_text}</td></tr>
- </table>
- <div style="clear: both"></div>
- </div>
-</%def>
-
-<%def name="render_review_comment( comment_text )">
- <style type="text/css">
- #reviews_table{ table-layout:fixed;
- width:100%;
- overflow-wrap:normal;
- overflow:hidden;
- border:0px;
- word-break:keep-all;
- word-wrap:break-word;
- line-break:strict; }
- </style>
- <table id="reviews_table">
- <tr><td>${comment_text}</td></tr>
- </table>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/index.mako
--- a/templates/webapps/community/index.mako
+++ /dev/null
@@ -1,165 +0,0 @@
-<%inherit file="/webapps/community/base_panels.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ## Include "base.css" for styling tool menu and forms (details)
- ${h.css( "base", "autocomplete_tagging", "tool_menu" )}
-
- ## But make sure styles for the layout take precedence
- ${parent.stylesheets()}
-
- <style type="text/css">
- body { margin: 0; padding: 0; overflow: hidden; }
- #left {
- background: #C1C9E5 url(${h.url_for('/static/style/menu_bg.png')}) top repeat-x;
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-</%def>
-
-<%def name="init()">
- <%
- self.has_left_panel=True
- self.has_right_panel=False
- self.active_view="tools"
- %>
- %if trans.app.config.require_login and not trans.user:
- <script type="text/javascript">
- if ( window != top ) {
- top.location.href = location.href;
- }
- </script>
- %endif
-</%def>
-
-<%def name="left_panel()">
- <% can_review_repositories = trans.app.security_agent.user_can_review_repositories( trans.user ) %>
- <div class="unified-panel-header" unselectable="on">
- <div class='unified-panel-header-inner'>${trans.app.shed_counter.valid_tools | h} valid tools on ${trans.app.shed_counter.generation_time | h}</div>
- </div>
- <div class="page-container" style="padding: 10px;">
- <div class="toolMenu">
- <div class="toolSectionList">
- %if user_id or repository_id:
- ## The route in was a sharable url, and may have included a changeset_revision, although we don't check for it.
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- All Repositories
- </div>
- <div class="toolTitle">
- <a href="${h.url_for( controller='repository', action='index' )}">Browse by category</a>
- </div>
- %else:
- %if repository_metadata:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Search
- </div>
- <div class="toolSectionBody">
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='find_tools' )}">Search for valid tools</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='find_workflows' )}">Search for workflows</a>
- </div>
- </div>
- %endif
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- All Repositories
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_categories' )}">Browse by category</a>
- </div>
- %if trans.user:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- My Repositories and Tools
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', operation='repositories_i_own' )}">Repositories I own</a>
- </div>
- %if has_reviewed_repositories:
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', operation='reviewed_repositories_i_own' )}">Reviewed repositories I own</a>
- </div>
- %endif
- %if has_deprecated_repositories:
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', operation='deprecated_repositories_i_own' )}">Deprecated repositories I own</a>
- </div>
- %endif
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', operation='my_writable_repositories' )}">My writable repositories</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_invalid_tools', cntrller='repository' )}">My invalid tools</a>
- </div>
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Available Actions
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='create_repository' )}">Create new repository</a>
- </div>
- %if can_review_repositories:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Reviewing Repositories
- </div>
- <div class="toolSectionBody">
- <div class="toolSectionBg">
- %if trans.user.repository_reviews:
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_reviewed_by_me' )}">Repositories reviewed by me</a>
- </div>
- %endif
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_reviews' )}">All reviewed repositories</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">Repositories with no reviews</a>
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_components' )}">Manage review components</a>
- </div>
- </div>
- </div>
- %endif
- %else:
- <div class="toolSectionPad"></div>
- <div class="toolSectionTitle">
- Available Actions
- </div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='/user', action='login' )}">Login to create a repository</a>
- </div>
- %endif
- %endif
- </div>
- </div>
- </div>
-</%def>
-
-<%def name="center_panel()">
- <%
- if trans.app.config.require_login and not trans.user:
- center_url = h.url_for( controller='user', action='login', message=message, status=status )
- elif repository_id and changeset_revision:
- # Route in was a sharable url: /view/{owner}/{name}/{changeset_revision}.
- center_url = h.url_for( controller='repository', action='view_repository', id=repository_id, changeset_revision=changeset_revision, message=message, status=status )
- elif repository_id:
- # Route in was a sharable url: /view/{owner}/{name}.
- center_url = h.url_for( controller='repository', action='view_repository', id=repository_id, message=message, status=status )
- elif user_id:
- # Route in was a sharable url: /view/{owner}.
- center_url = h.url_for( controller='repository', action='browse_repositories', operation="repositories_by_user", user_id=user_id, message=message, status=status )
- else:
- center_url = h.url_for( controller='repository', action='browse_categories', message=message, status=status )
- %>
- <iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe>
-</%def>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/message.mako
--- a/templates/webapps/community/message.mako
+++ /dev/null
@@ -1,1 +0,0 @@
-<%inherit file="../../message.mako"/>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/repository/browse_invalid_tools.mako
--- a/templates/webapps/community/repository/browse_invalid_tools.mako
+++ /dev/null
@@ -1,44 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-<div class="toolForm">
- %if invalid_tools_dict:
- <div class="toolFormTitle">Invalid tools<i> - click the tool config file name to see why the tool is invalid</i></div>
- <div class="form-row">
- <table class="grid">
- <tr>
- <th>Tool config</th>
- <th>Repository name</th>
- <th>Repository owner</th>
- <th>Changeset revision</th>
- </tr>
- %for invalid_tool_config, repository_tup in invalid_tools_dict.items():
- <% repository_id, repository_name, repository_owner, changeset_revision = repository_tup %>
- <tr>
- <td>
- <a class="view-info" href="${h.url_for( controller='repository', action='load_invalid_tool', repository_id=trans.security.encode_id( repository_id ), tool_config=invalid_tool_config, changeset_revision=changeset_revision )}">
- ${invalid_tool_config}
- </a>
- </td>
- <td>${repository_name | h}</td>
- <td>${repository_owner | h}</td>
- <td>${changeset_revision | h}</td>
- </tr>
- %endfor
- </table>
- </div>
- </div>
- %else:
- <div class="form-row">
- %if cntrller == 'admin' and trans.user_is_admin():
- No repositories in this tool shed contain invalid tools.
- %else:
- None of your repositories contain invalid tools.
- %endif
- </div>
- %endif
-</div>
diff -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 -r b985587c33926d8d38fa4456b51eecbc68953bb9 templates/webapps/community/repository/browse_repository.mako
--- a/templates/webapps/community/repository/browse_repository.mako
+++ /dev/null
@@ -1,156 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/webapps/community/common/common.mako" import="*" />
-<%namespace file="/webapps/community/repository/common.mako" import="*" />
-
-<%
- from galaxy.web.framework.helpers import time_ago
- is_admin = trans.user_is_admin()
- is_new = repository.is_new( trans.app )
- can_contact_owner = trans.user and trans.user != repository.user
- can_push = trans.app.security_agent.can_push( trans.app, trans.user, repository )
- can_upload = can_push and ( not repository.deprecated )
- can_download = not is_new and ( not is_malicious or can_push )
- can_browse_contents = not is_new
- can_rate = trans.user and repository.user != trans.user
- can_manage = is_admin or repository.user == trans.user
- can_view_change_log = not is_new
- has_readme = metadata and 'readme' in metadata
-%>
-
-<%!
- def inherit(context):
- if context.get('use_panels'):
- return '/webapps/community/base_panels.mako'
- else:
- return '/base.mako'
-%>
-<%inherit file="${inherit(context)}"/>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "jquery.rating", "dynatree_skin/ui.dynatree" )}
- <style type="text/css">
- ul.fileBrowser,
- ul.toolFile {
- margin-left: 0;
- padding-left: 0;
- list-style: none;
- }
- ul.fileBrowser {
- margin-left: 20px;
- }
- .fileBrowser li,
- .toolFile li {
- padding-left: 20px;
- background-repeat: no-repeat;
- background-position: 0;
- min-height: 20px;
- }
- .toolFile li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
- }
- .fileBrowser li {
- background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${h.js( "libs/jquery/jquery.rating", "libs/jquery/jquery-ui", "libs/jquery/jquery.cookie", "libs/jquery/jquery.dynatree" )}
- ${common_javascripts(repository)}
-</%def>
-
-<br/><br/>
-<ul class="manage-table-actions">
- %if is_new:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a>
- %else:
- <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li>
- <div popupmenu="repository-${repository.id}-popup">
- %if can_manage:
- <a class="action-button" href="${h.url_for( controller='repository', action='manage_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ) )}">Manage repository</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_repository', id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ) )}">View repository</a>
- %endif
- %if can_upload:
- <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a>
- %endif
- %if can_view_change_log:
- <a class="action-button" href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">View change log</a>
- %endif
- %if can_rate:
- <a class="action-button" href="${h.url_for( controller='repository', action='rate_repository', id=trans.app.security.encode_id( repository.id ) )}">Rate repository</a>
- %endif
- %if can_download:
- <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='gz' )}">Download as a .tar.gz file</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='bz2' )}">Download as a .tar.bz2 file</a>
- <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=repository.tip( trans.app ), file_type='zip' )}">Download as a zip file</a>
- %endif
- </div>
- %endif
-</ul>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-%if can_browse_contents:
- <div class="toolForm">
- <div class="toolFormTitle">Browse ${repository.name | h} revision ${repository.tip( trans.app ) | h} (repository tip)</div>
- %if can_download:
- <div class="form-row">
- <label>Clone this repository:</label>
- ${render_clone_str( repository )}
- </div>
- %endif
- %if can_push:
- <form name="select_files_to_delete" id="select_files_to_delete" action="${h.url_for( controller='repository', action='select_files_to_delete', id=trans.security.encode_id( repository.id ))}" method="post" >
- <div class="form-row" >
- <label>Contents:</label>
- <div id="tree" >
- Loading...
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Click on a file to display it's contents below. You may delete files from the repository by clicking the check box next to each file and clicking the <b>Delete selected files</b> button.
- </div>
- <input id="selected_files_to_delete" name="selected_files_to_delete" type="hidden" value=""/>
- </div>
- <div class="form-row">
- <label>Message:</label>
- <div class="form-row-input">
- %if commit_message:
- <textarea name="commit_message" rows="3" cols="35">${commit_message | h}</textarea>
- %else:
- <textarea name="commit_message" rows="3" cols="35"></textarea>
- %endif
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This is the commit message for the mercurial change set that will be created if you delete selected files.
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="select_files_to_delete_button" value="Delete selected files"/>
- </div>
- <div class="form-row">
- <div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
- </div>
- </form>
- %else:
- <div class="toolFormBody">
- <div class="form-row" >
- <label>Contents:</label>
- <div id="tree" >
- Loading...
- </div>
- </div>
- <div class="form-row">
- <div id="file_contents" class="toolParamHelp" style="clear: both;background-color:#FAFAFA;"></div>
- </div>
- </div>
- %endif
- </div>
- <p/>
-%endif
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: inithello: Added name attribute to MigrateToolsApplication to generate a correct metadata dict for migrated tools.
by commits-noreply@bitbucket.org 26 Feb '13
by commits-noreply@bitbucket.org 26 Feb '13
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ddfdfd2fce3e/
changeset: ddfdfd2fce3e
user: inithello
date: 2013-02-26 22:59:17
summary: Added name attribute to MigrateToolsApplication to generate a correct metadata dict for migrated tools.
affected #: 1 file
diff -r b9a7f2ae70a830e7ad5ef2a4c7e24f43d4575fa1 -r ddfdfd2fce3ef42d50f4b7b5a02db1cad03c5663 lib/tool_shed/galaxy_install/migrate/common.py
--- a/lib/tool_shed/galaxy_install/migrate/common.py
+++ b/lib/tool_shed/galaxy_install/migrate/common.py
@@ -14,6 +14,7 @@
def __init__( self, tools_migration_config ):
install_dependencies = 'install_dependencies' in sys.argv
galaxy_config_file = 'universe_wsgi.ini'
+ self.name = 'galaxy'
if '-c' in sys.argv:
pos = sys.argv.index( '-c' )
sys.argv.pop( pos )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b9a7f2ae70a8/
changeset: b9a7f2ae70a8
user: jgoecks
date: 2013-02-26 22:42:11
summary: Add missing import.
affected #: 1 file
diff -r 5d71d6193bbaf758ae901de19a601bce6c34aeca -r b9a7f2ae70a830e7ad5ef2a4c7e24f43d4575fa1 lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -6,6 +6,7 @@
from galaxy.web.base.controller import BaseUIController, SharableMixin, UsesVisualizationMixin
from galaxy.web.framework.helpers import time_ago, grids
from galaxy import util
+from galaxy.datatypes.interval import Bed
from galaxy.util.json import from_json_string
from galaxy.util.sanitize_html import sanitize_html
from galaxy.visualization.genomes import decode_dbkey
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Force absolute imprts in Galaxy's app.
by commits-noreply@bitbucket.org 26 Feb '13
by commits-noreply@bitbucket.org 26 Feb '13
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5d71d6193bba/
changeset: 5d71d6193bba
user: greg
date: 2013-02-26 22:33:57
summary: Force absolute imprts in Galaxy's app.
affected #: 1 file
diff -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e -r 5d71d6193bbaf758ae901de19a601bce6c34aeca lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
import sys, os, atexit
from galaxy import config, jobs, util, tools, web
@@ -151,10 +152,10 @@
self.memdump = memdump.Memdump()
# Transfer manager client
if self.config.get_bool( 'enable_beta_job_managers', False ):
- from jobs import transfer_manager
+ from galaxy.jobs import transfer_manager
self.transfer_manager = transfer_manager.TransferManager( self )
# Start the job manager
- from jobs import manager
+ from galaxy.jobs import manager
self.job_manager = manager.JobManager( self )
# FIXME: These are exposed directly for backward compatibility
self.job_queue = self.job_manager.job_queue
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Move ~/lib/galaxy/tool_shed to ~/lib/tool_shed, and move the ~/lib/galaxy/util/shed_util componets to ~/lib/tool_shed/util.
by commits-noreply@bitbucket.org 26 Feb '13
by commits-noreply@bitbucket.org 26 Feb '13
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6f0050c4e06e/
changeset: 6f0050c4e06e
user: greg
date: 2013-02-26 21:52:51
summary: Move ~/lib/galaxy/tool_shed to ~/lib/tool_shed, and move the ~/lib/galaxy/util/shed_util componets to ~/lib/tool_shed/util.
affected #: 77 files
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -3,8 +3,8 @@
from galaxy import config, jobs, util, tools, web
import galaxy.tools.search
import galaxy.tools.data
-import galaxy.tool_shed
-import galaxy.tool_shed.tool_shed_registry
+import tool_shed.galaxy_install
+import tool_shed.tool_shed_registry
from galaxy.web import security
import galaxy.model
import galaxy.datatypes.registry
@@ -41,7 +41,7 @@
db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
# Set up the tool sheds registry
if os.path.isfile( self.config.tool_sheds_config ):
- self.tool_shed_registry = galaxy.tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
+ self.tool_shed_registry = tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
else:
self.tool_shed_registry = None
log.debug( 'self.config.tool_sheds_config: %s, self.tool_shed_registry: %s',
@@ -51,7 +51,7 @@
from galaxy.model.migrate.check import create_or_verify_database
create_or_verify_database( db_url, kwargs.get( 'global_conf', {} ).get( '__file__', None ), self.config.database_engine_options, app=self )
# Alert the Galaxy admin to tools that have been moved from the distribution to the tool shed.
- from galaxy.tool_shed.migrate.check import verify_tools
+ from tool_shed.galaxy_install.migrate.check import verify_tools
verify_tools( self, db_url, kwargs.get( 'global_conf', {} ).get( '__file__', None ), self.config.database_engine_options )
# Object store manager
self.object_store = build_object_store_from_config(self.config)
@@ -64,7 +64,7 @@
object_store = self.object_store,
trace_logger=self.trace_logger )
# Manage installed tool shed repositories.
- self.installed_repository_manager = galaxy.tool_shed.InstalledRepositoryManager( self )
+ self.installed_repository_manager = tool_shed.galaxy_install.InstalledRepositoryManager( self )
# Create an empty datatypes registry.
self.datatypes_registry = galaxy.datatypes.registry.Registry()
# Load proprietary datatypes defined in datatypes_conf.xml files in all installed tool shed repositories. We
@@ -105,7 +105,7 @@
self.data_managers = DataManagers( self )
# If enabled, poll respective tool sheds to see if updates are available for any installed tool shed repositories.
if self.config.get_bool( 'enable_tool_shed_check', False ):
- from tool_shed import update_manager
+ from tool_shed.galaxy_install import update_manager
self.update_manager = update_manager.UpdateManager( self )
# Load proprietary datatype converters and display applications.
self.installed_repository_manager.load_proprietary_converters_and_display_applications()
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3031,6 +3031,10 @@
pass
class ToolShedRepository( object ):
+ api_collection_visible_keys = ( 'id', 'name', 'tool_shed', 'owner', 'installed_changeset_revision', 'changeset_revision', 'ctx_rev', 'includes_datatypes',
+ 'update_available', 'deleted', 'uninstalled', 'dist_to_shed', 'status', 'error_message' )
+ api_element_visible_keys = ( 'id', 'name', 'tool_shed', 'owner', 'installed_changeset_revision', 'changeset_revision', 'ctx_rev', 'includes_datatypes',
+ 'update_available', 'deleted', 'uninstalled', 'dist_to_shed', 'status', 'error_message' )
installation_status = Bunch( NEW='New',
CLONING='Cloning',
SETTING_TOOL_VERSIONS='Setting tool versions',
@@ -3066,6 +3070,10 @@
self.dist_to_shed = dist_to_shed
self.status = status
self.error_message = error_message
+ def as_dict( self, trans ):
+ tsr_dict = self.get_api_value( view='element' )
+ tsr_dict[ 'id' ] = trans.security.encode_id( self.id )
+ return tsr_dict
def repo_files_directory( self, app ):
repo_path = self.repo_path( app )
if repo_path:
@@ -3153,6 +3161,22 @@
if self.shed_config_filename == shed_tool_conf_dict[ 'config_filename' ]:
return shed_tool_conf_dict
return default
+ def get_api_value( self, view='collection', value_mapper=None ):
+ if value_mapper is None:
+ value_mapper = {}
+ rval = {}
+ try:
+ visible_keys = self.__getattribute__( 'api_' + view + '_visible_keys' )
+ except AttributeError:
+ raise Exception( 'Unknown API view: %s' % view )
+ for key in visible_keys:
+ try:
+ rval[ key ] = self.__getattribute__( key )
+ if key in value_mapper:
+ rval[ key ] = value_mapper.get( key )( rval[ key ] )
+ except AttributeError:
+ rval[ key ] = None
+ return rval
@property
def can_install( self ):
return self.status == self.installation_status.NEW
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/model/migrate/versions/0113_update_migrate_tools_table.py
--- /dev/null
+++ b/lib/galaxy/model/migrate/versions/0113_update_migrate_tools_table.py
@@ -0,0 +1,44 @@
+"""
+Migration script to update the migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate.
+"""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+
+import datetime
+now = datetime.datetime.utcnow
+# Need our custom types, but don't import anything else from model
+from galaxy.model.custom_types import *
+
+import sys, logging
+log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
+
+metadata = MetaData( migrate_engine )
+db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
+
+def upgrade():
+ print __doc__
+
+ metadata.reflect()
+ # Create the table.
+ try:
+ cmd = "UPDATE migrate_tools set repository_path='lib/galaxy/tool_shed/migrate';"
+ db_session.execute( cmd )
+ except Exception, e:
+ log.debug( "Updating migrate_tools.repository_path column to point to the new location lib/tool_shed/galaxy_install/migrate failed: %s" % str( e ) )
+
+def downgrade():
+ metadata.reflect()
+ try:
+ cmd = "UPDATE migrate_tools set repository_path='lib/galaxy/tool_shed/migrate';"
+ db_session.execute( cmd )
+ except Exception, e:
+ log.debug( "Updating migrate_tools.repository_path column to point to the old location lib/galaxy/tool_shed/migrate failed: %s" % str( e ) )
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/__init__.py
--- a/lib/galaxy/tool_shed/__init__.py
+++ /dev/null
@@ -1,57 +0,0 @@
-"""
-Classes encapsulating the management of repositories installed from Galaxy tool sheds.
-"""
-import os
-import galaxy.util.shed_util
-import galaxy.util.shed_util_common
-from galaxy.model.orm import and_
-
-from galaxy import eggs
-import pkg_resources
-
-pkg_resources.require( 'elementtree' )
-from elementtree import ElementTree, ElementInclude
-
-class InstalledRepositoryManager( object ):
- def __init__( self, app ):
- self.app = app
- self.model = self.app.model
- self.sa_session = self.model.context.current
- self.tool_configs = self.app.config.tool_configs
- if self.app.config.migrated_tools_config not in self.tool_configs:
- self.tool_configs.append( self.app.config.migrated_tools_config )
- self.installed_repository_dicts = []
- def get_repository_install_dir( self, tool_shed_repository ):
- for tool_config in self.tool_configs:
- tree = ElementTree.parse( tool_config )
- root = tree.getroot()
- ElementInclude.include( root )
- tool_path = root.get( 'tool_path', None )
- if tool_path:
- tool_shed = galaxy.util.shed_util_common.clean_tool_shed_url( tool_shed_repository.tool_shed )
- relative_path = os.path.join( tool_path,
- tool_shed,
- 'repos',
- tool_shed_repository.owner,
- tool_shed_repository.name,
- tool_shed_repository.installed_changeset_revision )
- if os.path.exists( relative_path ):
- return relative_path
- return None
- def load_proprietary_datatypes( self ):
- for tool_shed_repository in self.sa_session.query( self.model.ToolShedRepository ) \
- .filter( and_( self.model.ToolShedRepository.table.c.includes_datatypes==True,
- self.model.ToolShedRepository.table.c.deleted==False ) ) \
- .order_by( self.model.ToolShedRepository.table.c.id ):
- relative_install_dir = self.get_repository_install_dir( tool_shed_repository )
- if relative_install_dir:
- installed_repository_dict = galaxy.util.shed_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir )
- if installed_repository_dict:
- self.installed_repository_dicts.append( installed_repository_dict )
- def load_proprietary_converters_and_display_applications( self, deactivate=False ):
- for installed_repository_dict in self.installed_repository_dicts:
- if installed_repository_dict[ 'converter_path' ]:
- galaxy.util.shed_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate )
- if installed_repository_dict[ 'display_path' ]:
- galaxy.util.shed_util.load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate )
-
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/common_util.py
--- a/lib/galaxy/tool_shed/common_util.py
+++ /dev/null
@@ -1,93 +0,0 @@
-import os, urllib2
-from galaxy import util
-from galaxy.util.odict import odict
-from galaxy.tool_shed import encoding_util
-
-REPOSITORY_OWNER = 'devteam'
-
-def check_for_missing_tools( app, tool_panel_configs, latest_tool_migration_script_number ):
- # Get the 000x_tools.xml file associated with the current migrate_tools version number.
- tools_xml_file_path = os.path.abspath( os.path.join( 'scripts', 'migrate_tools', '%04d_tools.xml' % latest_tool_migration_script_number ) )
- # Parse the XML and load the file attributes for later checking against the proprietary tool_panel_config.
- migrated_tool_configs_dict = odict()
- tree = util.parse_xml( tools_xml_file_path )
- root = tree.getroot()
- tool_shed = root.get( 'name' )
- tool_shed_url = get_tool_shed_url_from_tools_xml_file_path( app, tool_shed )
- # The default behavior is that the tool shed is down.
- tool_shed_accessible = False
- if tool_shed_url:
- for elem in root:
- if elem.tag == 'repository':
- tool_dependencies = []
- tool_dependencies_dict = {}
- repository_name = elem.get( 'name' )
- changeset_revision = elem.get( 'changeset_revision' )
- url = '%s/repository/get_tool_dependencies?name=%s&owner=%s&changeset_revision=%s&from_install_manager=True' % \
- ( tool_shed_url, repository_name, REPOSITORY_OWNER, changeset_revision )
- try:
- response = urllib2.urlopen( url )
- text = response.read()
- response.close()
- tool_shed_accessible = True
- except Exception, e:
- # Tool shed may be unavailable - we have to set tool_shed_accessible since we're looping.
- tool_shed_accessible = False
- print "The URL\n%s\nraised the exception:\n%s\n" % ( url, str( e ) )
- if tool_shed_accessible:
- if text:
- tool_dependencies_dict = encoding_util.tool_shed_decode( text )
- for dependency_key, requirements_dict in tool_dependencies_dict.items():
- tool_dependency_name = requirements_dict[ 'name' ]
- tool_dependency_version = requirements_dict[ 'version' ]
- tool_dependency_type = requirements_dict[ 'type' ]
- tool_dependency_readme = requirements_dict.get( 'readme', '' )
- tool_dependencies.append( ( tool_dependency_name, tool_dependency_version, tool_dependency_type, tool_dependency_readme ) )
- for tool_elem in elem.findall( 'tool' ):
- migrated_tool_configs_dict[ tool_elem.get( 'file' ) ] = tool_dependencies
- if tool_shed_accessible:
- # Parse the proprietary tool_panel_configs (the default is tool_conf.xml) and generate the list of missing tool config file names.
- missing_tool_configs_dict = odict()
- for tool_panel_config in tool_panel_configs:
- tree = util.parse_xml( tool_panel_config )
- root = tree.getroot()
- for elem in root:
- if elem.tag == 'tool':
- missing_tool_configs_dict = check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict )
- elif elem.tag == 'section':
- for section_elem in elem:
- if section_elem.tag == 'tool':
- missing_tool_configs_dict = check_tool_tag_set( section_elem, migrated_tool_configs_dict, missing_tool_configs_dict )
- else:
- exception_msg = '\n\nThe entry for the main Galaxy tool shed at %s is missing from the %s file. ' % ( tool_shed, app.config.tool_sheds_config )
- exception_msg += 'The entry for this tool shed must always be available in this file, so re-add it before attempting to start your Galaxy server.\n'
- raise Exception( exception_msg )
- return tool_shed_accessible, missing_tool_configs_dict
-def check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict ):
- file_path = elem.get( 'file', None )
- if file_path:
- path, name = os.path.split( file_path )
- if name in migrated_tool_configs_dict:
- tool_dependencies = migrated_tool_configs_dict[ name ]
- missing_tool_configs_dict[ name ] = tool_dependencies
- return missing_tool_configs_dict
-def get_non_shed_tool_panel_configs( app ):
- # Get the non-shed related tool panel configs - there can be more than one, and the default is tool_conf.xml.
- config_filenames = []
- for config_filename in app.config.tool_configs:
- # Any config file that includes a tool_path attribute in the root tag set like the following is shed-related.
- # <toolbox tool_path="../shed_tools">
- tree = util.parse_xml( config_filename )
- root = tree.getroot()
- tool_path = root.get( 'tool_path', None )
- if tool_path is None:
- config_filenames.append( config_filename )
- return config_filenames
-def get_tool_shed_url_from_tools_xml_file_path( app, tool_shed ):
- search_str = '://%s' % tool_shed
- for shed_name, shed_url in app.tool_shed_registry.tool_sheds.items():
- if shed_url.find( search_str ) >= 0:
- if shed_url.endswith( '/' ):
- shed_url = shed_url.rstrip( '/' )
- return shed_url
- return None
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/encoding_util.py
--- a/lib/galaxy/tool_shed/encoding_util.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import binascii, logging
-from galaxy.util.hash_util import hmac_new
-from galaxy.util.json import json_fix
-
-from galaxy import eggs
-import pkg_resources
-
-pkg_resources.require( "simplejson" )
-import simplejson
-
-log = logging.getLogger( __name__ )
-
-encoding_sep = '__esep__'
-encoding_sep2 = '__esepii__'
-
-def tool_shed_decode( value ):
- # Extract and verify hash
- a, b = value.split( ":" )
- value = binascii.unhexlify( b )
- test = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value )
- assert a == test
- # Restore from string
- values = None
- try:
- values = simplejson.loads( value )
- except Exception, e:
- log.debug( "Decoding json value from tool shed for value '%s' threw exception: %s" % ( str( value ), str( e ) ) )
- if values is not None:
- try:
- return json_fix( values )
- except Exception, e:
- log.debug( "Fixing decoded json values '%s' from tool shed threw exception: %s" % ( str( values ), str( e ) ) )
- fixed_values = values
- if values is None:
- values = value
- return values
-def tool_shed_encode( val ):
- if isinstance( val, dict ):
- value = simplejson.dumps( val )
- else:
- value = val
- a = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value )
- b = binascii.hexlify( value )
- return "%s:%s" % ( a, b )
\ No newline at end of file
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/install_manager.py
--- a/lib/galaxy/tool_shed/install_manager.py
+++ /dev/null
@@ -1,372 +0,0 @@
-"""
-Manage automatic installation of tools configured in the xxx.xml files in ~/scripts/migrate_tools (e.g., 0002_tools.xml).
-All of the tools were at some point included in the Galaxy distribution, but are now hosted in the main Galaxy tool shed.
-"""
-import os, urllib2, tempfile
-from galaxy import util
-from galaxy.tools import ToolSection
-from galaxy.util.json import from_json_string, to_json_string
-import galaxy.util.shed_util as shed_util
-import galaxy.util.shed_util_common as suc
-from galaxy.util.odict import odict
-from galaxy.tool_shed import common_util
-
-class InstallManager( object ):
- def __init__( self, app, latest_migration_script_number, tool_shed_install_config, migrated_tools_config, install_dependencies ):
- """
- Check tool settings in tool_shed_install_config and install all repositories that are not already installed. The tool
- panel configuration file is the received migrated_tools_config, which is the reserved file named migrated_tools_conf.xml.
- """
- self.app = app
- self.toolbox = self.app.toolbox
- self.migrated_tools_config = migrated_tools_config
- # If install_dependencies is True but tool_dependency_dir is not set, do not attempt to install but print informative error message.
- if install_dependencies and app.config.tool_dependency_dir is None:
- message = 'You are attempting to install tool dependencies but do not have a value for "tool_dependency_dir" set in your universe_wsgi.ini '
- message += 'file. Set this location value to the path where you want tool dependencies installed and rerun the migration script.'
- raise Exception( message )
- # Get the local non-shed related tool panel configs (there can be more than one, and the default name is tool_conf.xml).
- self.proprietary_tool_confs = self.non_shed_tool_panel_configs
- self.proprietary_tool_panel_elems = self.get_proprietary_tool_panel_elems( latest_migration_script_number )
- # Set the location where the repositories will be installed by retrieving the tool_path setting from migrated_tools_config.
- tree = util.parse_xml( migrated_tools_config )
- root = tree.getroot()
- self.tool_path = root.get( 'tool_path' )
- print "Repositories will be installed into configured tool_path location ", str( self.tool_path )
- # Parse tool_shed_install_config to check each of the tools.
- self.tool_shed_install_config = tool_shed_install_config
- tree = util.parse_xml( tool_shed_install_config )
- root = tree.getroot()
- self.tool_shed = suc.clean_tool_shed_url( root.get( 'name' ) )
- self.repository_owner = common_util.REPOSITORY_OWNER
- index, self.shed_config_dict = suc.get_shed_tool_conf_dict( app, self.migrated_tools_config )
- # Since tool migration scripts can be executed any number of times, we need to make sure the appropriate tools are defined in
- # tool_conf.xml. If no tools associated with the migration stage are defined, no repositories will be installed on disk.
- # The default behavior is that the tool shed is down.
- tool_shed_accessible = False
- tool_panel_configs = common_util.get_non_shed_tool_panel_configs( app )
- if tool_panel_configs:
- # The missing_tool_configs_dict contents are something like:
- # {'emboss_antigenic.xml': [('emboss', '5.0.0', 'package', '\nreadme blah blah blah\n')]}
- tool_shed_accessible, missing_tool_configs_dict = common_util.check_for_missing_tools( app, tool_panel_configs, latest_migration_script_number )
- else:
- # It doesn't matter if the tool shed is accessible since there are no migrated tools defined in the local Galaxy instance, but
- # we have to set the value of tool_shed_accessible to True so that the value of migrate_tools.version can be correctly set in
- # the database.
- tool_shed_accessible = True
- missing_tool_configs_dict = odict()
- if tool_shed_accessible:
- if len( self.proprietary_tool_confs ) == 1:
- plural = ''
- file_names = self.proprietary_tool_confs[ 0 ]
- else:
- plural = 's'
- file_names = ', '.join( self.proprietary_tool_confs )
- if missing_tool_configs_dict:
- for repository_elem in root:
- self.install_repository( repository_elem, install_dependencies )
- else:
- message = "\nNo tools associated with migration stage %s are defined in your " % str( latest_migration_script_number )
- message += "file%s named %s,\nso no repositories will be installed on disk.\n" % ( plural, file_names )
- print message
- else:
- message = "\nThe main Galaxy tool shed is not currently available, so skipped migration stage %s.\n" % str( latest_migration_script_number )
- message += "Try again later.\n"
- print message
- def get_guid( self, repository_clone_url, relative_install_dir, tool_config ):
- if self.shed_config_dict.get( 'tool_path' ):
- relative_install_dir = os.path.join( self.shed_config_dict['tool_path'], relative_install_dir )
- found = False
- for root, dirs, files in os.walk( relative_install_dir ):
- if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
- if '.hg' in dirs:
- dirs.remove( '.hg' )
- for name in files:
- if name == tool_config:
- found = True
- break
- if found:
- break
- full_path = str( os.path.abspath( os.path.join( root, name ) ) )
- tool = self.toolbox.load_tool( full_path )
- return suc.generate_tool_guid( repository_clone_url, tool )
- def get_proprietary_tool_panel_elems( self, latest_tool_migration_script_number ):
- # Parse each config in self.proprietary_tool_confs (the default is tool_conf.xml) and generate a list of Elements that are
- # either ToolSection elements or Tool elements. These will be used to generate new entries in the migrated_tools_conf.xml
- # file for the installed tools.
- tools_xml_file_path = os.path.abspath( os.path.join( 'scripts', 'migrate_tools', '%04d_tools.xml' % latest_tool_migration_script_number ) )
- # Parse the XML and load the file attributes for later checking against the integrated elements from self.proprietary_tool_confs.
- migrated_tool_configs = []
- tree = util.parse_xml( tools_xml_file_path )
- root = tree.getroot()
- for elem in root:
- if elem.tag == 'repository':
- for tool_elem in elem:
- migrated_tool_configs.append( tool_elem.get( 'file' ) )
- # Parse each file in self.proprietary_tool_confs and generate the integrated list of tool panel Elements that contain them.
- tool_panel_elems = []
- for proprietary_tool_conf in self.proprietary_tool_confs:
- tree = util.parse_xml( proprietary_tool_conf )
- root = tree.getroot()
- for elem in root:
- if elem.tag == 'tool':
- # Tools outside of sections.
- file_path = elem.get( 'file', None )
- if file_path:
- name = suc.strip_path( file_path )
- if name in migrated_tool_configs:
- if elem not in tool_panel_elems:
- tool_panel_elems.append( elem )
- elif elem.tag == 'section':
- # Tools contained in a section.
- for section_elem in elem:
- if section_elem.tag == 'tool':
- file_path = section_elem.get( 'file', None )
- if file_path:
- name = suc.strip_path( file_path )
- if name in migrated_tool_configs:
- # Append the section, not the tool.
- if elem not in tool_panel_elems:
- tool_panel_elems.append( elem )
- return tool_panel_elems
- def get_containing_tool_sections( self, tool_config ):
- """
- If tool_config is defined somewhere in self.proprietary_tool_panel_elems, return True and a list of ToolSections in which the
- tool is displayed. If the tool is displayed outside of any sections, None is appended to the list.
- """
- tool_sections = []
- is_displayed = False
- for proprietary_tool_panel_elem in self.proprietary_tool_panel_elems:
- if proprietary_tool_panel_elem.tag == 'tool':
- # The proprietary_tool_panel_elem looks something like <tool file="emboss_5/emboss_antigenic.xml" />.
- proprietary_tool_config = proprietary_tool_panel_elem.get( 'file' )
- proprietary_name = suc.strip_path( proprietary_tool_config )
- if tool_config == proprietary_name:
- # The tool is loaded outside of any sections.
- tool_sections.append( None )
- if not is_displayed:
- is_displayed = True
- if proprietary_tool_panel_elem.tag == 'section':
- # The proprietary_tool_panel_elem looks something like <section name="EMBOSS" id="EMBOSSLite">.
- for section_elem in proprietary_tool_panel_elem:
- if section_elem.tag == 'tool':
- # The section_elem looks something like <tool file="emboss_5/emboss_antigenic.xml" />.
- proprietary_tool_config = section_elem.get( 'file' )
- proprietary_name = suc.strip_path( proprietary_tool_config )
- if tool_config == proprietary_name:
- # The tool is loaded inside of the section_elem.
- tool_sections.append( ToolSection( proprietary_tool_panel_elem ) )
- if not is_displayed:
- is_displayed = True
- return is_displayed, tool_sections
- def handle_repository_contents( self, tool_shed_repository, repository_clone_url, relative_install_dir, repository_elem, install_dependencies ):
- """Generate the metadata for the installed tool shed repository, among other things."""
- tool_panel_dict_for_display = odict()
- if self.tool_path:
- repo_install_dir = os.path.join( self.tool_path, relative_install_dir )
- else:
- repo_install_dir = relative_install_dir
- for tool_elem in repository_elem:
- # The tool_elem looks something like this: <tool id="EMBOSS: antigenic1" version="5.0.0" file="emboss_antigenic.xml" />
- tool_config = tool_elem.get( 'file' )
- guid = self.get_guid( repository_clone_url, relative_install_dir, tool_config )
- # See if tool_config is defined inside of a section in self.proprietary_tool_panel_elems.
- is_displayed, tool_sections = self.get_containing_tool_sections( tool_config )
- if is_displayed:
- tool_panel_dict_for_tool_config = shed_util.generate_tool_panel_dict_for_tool_config( guid, tool_config, tool_sections=tool_sections )
- for k, v in tool_panel_dict_for_tool_config.items():
- tool_panel_dict_for_display[ k ] = v
- else:
- print 'The tool "%s" (%s) has not been enabled because it is not defined in a proprietary tool config (%s).' \
- % ( guid, tool_config, ", ".join( self.proprietary_tool_confs or [] ) )
- metadata_dict, invalid_file_tups = suc.generate_metadata_for_changeset_revision( app=self.app,
- repository=tool_shed_repository,
- changeset_revision=tool_shed_repository.changeset_revision,
- repository_clone_url=repository_clone_url,
- shed_config_dict = self.shed_config_dict,
- relative_install_dir=relative_install_dir,
- repository_files_dir=None,
- resetting_all_metadata_on_repository=False,
- updating_installed_repository=False,
- persist=True )
- tool_shed_repository.metadata = metadata_dict
- self.app.sa_session.add( tool_shed_repository )
- self.app.sa_session.flush()
- if 'tool_dependencies' in metadata_dict:
- # All tool_dependency objects must be created before the tools are processed even if no tool dependencies will be installed.
- tool_dependencies = shed_util.create_tool_dependency_objects( self.app, tool_shed_repository, relative_install_dir, set_status=True )
- else:
- tool_dependencies = None
- if 'tools' in metadata_dict:
- sample_files = metadata_dict.get( 'sample_files', [] )
- sample_files = [ str( s ) for s in sample_files ]
- tool_index_sample_files = shed_util.get_tool_index_sample_files( sample_files )
- shed_util.copy_sample_files( self.app, tool_index_sample_files, tool_path=self.tool_path )
- sample_files_copied = [ s for s in tool_index_sample_files ]
- repository_tools_tups = suc.get_repository_tools_tups( self.app, metadata_dict )
- if repository_tools_tups:
- # Handle missing data table entries for tool parameters that are dynamically generated select lists.
- repository_tools_tups = shed_util.handle_missing_data_table_entry( self.app, relative_install_dir, self.tool_path, repository_tools_tups )
- # Handle missing index files for tool parameters that are dynamically generated select lists.
- repository_tools_tups, sample_files_copied = shed_util.handle_missing_index_file( self.app,
- self.tool_path,
- sample_files,
- repository_tools_tups,
- sample_files_copied )
- # Copy remaining sample files included in the repository to the ~/tool-data directory of the local Galaxy instance.
- shed_util.copy_sample_files( self.app, sample_files, tool_path=self.tool_path, sample_files_copied=sample_files_copied )
- if install_dependencies and tool_dependencies and 'tool_dependencies' in metadata_dict:
- # Install tool dependencies.
- shed_util.update_tool_shed_repository_status( self.app,
- tool_shed_repository,
- self.app.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
- # Get the tool_dependencies.xml file from disk.
- tool_dependencies_config = suc.get_config_from_disk( 'tool_dependencies.xml', repo_install_dir )
- installed_tool_dependencies = shed_util.handle_tool_dependencies( app=self.app,
- tool_shed_repository=tool_shed_repository,
- tool_dependencies_config=tool_dependencies_config,
- tool_dependencies=tool_dependencies )
- for installed_tool_dependency in installed_tool_dependencies:
- if installed_tool_dependency.status == self.app.model.ToolDependency.installation_status.ERROR:
- print '\nThe following error occurred from the InstallManager while installing tool dependency ', installed_tool_dependency.name, ':'
- print installed_tool_dependency.error_message, '\n\n'
- shed_util.add_to_tool_panel( self.app,
- tool_shed_repository.name,
- repository_clone_url,
- tool_shed_repository.installed_changeset_revision,
- repository_tools_tups,
- self.repository_owner,
- self.migrated_tools_config,
- tool_panel_dict=tool_panel_dict_for_display,
- new_install=True )
- if 'datatypes' in metadata_dict:
- tool_shed_repository.status = self.app.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
- if not tool_shed_repository.includes_datatypes:
- tool_shed_repository.includes_datatypes = True
- self.app.sa_session.add( tool_shed_repository )
- self.app.sa_session.flush()
- work_dir = tempfile.mkdtemp()
- datatypes_config = suc.get_config_from_disk( 'datatypes_conf.xml', repo_install_dir )
- # Load proprietary data types required by tools. The value of override is not important here since the Galaxy server will be started
- # after this installation completes.
- converter_path, display_path = shed_util.alter_config_and_load_prorietary_datatypes( self.app, datatypes_config, repo_install_dir, override=False ) #repo_install_dir was relative_install_dir
- if converter_path or display_path:
- # Create a dictionary of tool shed repository related information.
- repository_dict = shed_util.create_repository_dict_for_proprietary_datatypes( tool_shed=self.tool_shed,
- name=tool_shed_repository.name,
- owner=self.repository_owner,
- installed_changeset_revision=tool_shed_repository.installed_changeset_revision,
- tool_dicts=metadata_dict.get( 'tools', [] ),
- converter_path=converter_path,
- display_path=display_path )
- if converter_path:
- # Load proprietary datatype converters
- self.app.datatypes_registry.load_datatype_converters( self.toolbox, installed_repository_dict=repository_dict )
- if display_path:
- # Load proprietary datatype display applications
- self.app.datatypes_registry.load_display_applications( installed_repository_dict=repository_dict )
- try:
- shutil.rmtree( work_dir )
- except:
- pass
- def install_repository( self, repository_elem, install_dependencies ):
- # Install a single repository, loading contained tools into the tool panel.
- name = repository_elem.get( 'name' )
- description = repository_elem.get( 'description' )
- installed_changeset_revision = repository_elem.get( 'changeset_revision' )
- # Install path is of the form: <tool path>/<tool shed>/repos/<repository owner>/<repository name>/<installed changeset revision>
- relative_clone_dir = os.path.join( self.tool_shed, 'repos', self.repository_owner, name, installed_changeset_revision )
- clone_dir = os.path.join( self.tool_path, relative_clone_dir )
- if self.__isinstalled( clone_dir ):
- print "Skipping automatic install of repository '", name, "' because it has already been installed in location ", clone_dir
- else:
- tool_shed_url = self.__get_url_from_tool_shed( self.tool_shed )
- repository_clone_url = os.path.join( tool_shed_url, 'repos', self.repository_owner, name )
- relative_install_dir = os.path.join( relative_clone_dir, name )
- install_dir = os.path.join( clone_dir, name )
- ctx_rev = suc.get_ctx_rev( tool_shed_url, name, self.repository_owner, installed_changeset_revision )
- tool_shed_repository = suc.create_or_update_tool_shed_repository( app=self.app,
- name=name,
- description=description,
- installed_changeset_revision=installed_changeset_revision,
- ctx_rev=ctx_rev,
- repository_clone_url=repository_clone_url,
- metadata_dict={},
- status=self.app.model.ToolShedRepository.installation_status.NEW,
- current_changeset_revision=None,
- owner=self.repository_owner,
- dist_to_shed=True )
- shed_util.update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.CLONING )
- cloned_ok, error_message = suc.clone_repository( repository_clone_url, os.path.abspath( install_dir ), ctx_rev )
- if cloned_ok:
- self.handle_repository_contents( tool_shed_repository=tool_shed_repository,
- repository_clone_url=repository_clone_url,
- relative_install_dir=relative_install_dir,
- repository_elem=repository_elem,
- install_dependencies=install_dependencies )
- self.app.sa_session.refresh( tool_shed_repository )
- metadata_dict = tool_shed_repository.metadata
- if 'tools' in metadata_dict:
- shed_util.update_tool_shed_repository_status( self.app,
- tool_shed_repository,
- self.app.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
- # Get the tool_versions from the tool shed for each tool in the installed change set.
- url = '%s/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % \
- ( tool_shed_url, tool_shed_repository.name, self.repository_owner, installed_changeset_revision )
- response = urllib2.urlopen( url )
- text = response.read()
- response.close()
- if text:
- tool_version_dicts = from_json_string( text )
- shed_util.handle_tool_versions( self.app, tool_version_dicts, tool_shed_repository )
- else:
- # Set the tool versions since they seem to be missing for this repository in the tool shed.
- # CRITICAL NOTE: These default settings may not properly handle all parent/child associations.
- for tool_dict in metadata_dict[ 'tools' ]:
- flush_needed = False
- tool_id = tool_dict[ 'guid' ]
- old_tool_id = tool_dict[ 'id' ]
- tool_version = tool_dict[ 'version' ]
- tool_version_using_old_id = shed_util.get_tool_version( self.app, old_tool_id )
- tool_version_using_guid = shed_util.get_tool_version( self.app, tool_id )
- if not tool_version_using_old_id:
- tool_version_using_old_id = self.app.model.ToolVersion( tool_id=old_tool_id,
- tool_shed_repository=tool_shed_repository )
- self.app.sa_session.add( tool_version_using_old_id )
- self.app.sa_session.flush()
- if not tool_version_using_guid:
- tool_version_using_guid = self.app.model.ToolVersion( tool_id=tool_id,
- tool_shed_repository=tool_shed_repository )
- self.app.sa_session.add( tool_version_using_guid )
- self.app.sa_session.flush()
- # Associate the two versions as parent / child.
- tool_version_association = shed_util.get_tool_version_association( self.app,
- tool_version_using_old_id,
- tool_version_using_guid )
- if not tool_version_association:
- tool_version_association = self.app.model.ToolVersionAssociation( tool_id=tool_version_using_guid.id,
- parent_id=tool_version_using_old_id.id )
- self.app.sa_session.add( tool_version_association )
- self.app.sa_session.flush()
- shed_util.update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.INSTALLED )
- @property
- def non_shed_tool_panel_configs( self ):
- return common_util.get_non_shed_tool_panel_configs( self.app )
- def __get_url_from_tool_shed( self, tool_shed ):
- # The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like:
- # http://toolshed.g2.bx.psu.edu/
- for shed_name, shed_url in self.app.tool_shed_registry.tool_sheds.items():
- if shed_url.find( tool_shed ) >= 0:
- if shed_url.endswith( '/' ):
- shed_url = shed_url.rstrip( '/' )
- return shed_url
- # The tool shed from which the repository was originally installed must no longer be configured in tool_sheds_conf.xml.
- return None
- def __isinstalled( self, clone_dir ):
- full_path = os.path.abspath( clone_dir )
- if os.path.exists( full_path ):
- for root, dirs, files in os.walk( full_path ):
- if '.hg' in dirs:
- # Assume that the repository has been installed if we find a .hg directory.
- return True
- return False
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/check.py
--- a/lib/galaxy/tool_shed/migrate/check.py
+++ /dev/null
@@ -1,171 +0,0 @@
-import sys, os, logging, subprocess
-from galaxy import eggs
-import pkg_resources
-pkg_resources.require( "sqlalchemy-migrate" )
-
-from migrate.versioning import repository, schema
-from sqlalchemy import *
-from galaxy.util.odict import odict
-from galaxy.tool_shed import common_util
-
-log = logging.getLogger( __name__ )
-
-# Path relative to galaxy
-migrate_repository_directory = os.path.dirname( __file__ ).replace( os.getcwd() + os.path.sep, '', 1 )
-migrate_repository = repository.Repository( migrate_repository_directory )
-dialect_to_egg = {
- "sqlite" : "pysqlite>=2",
- "postgres" : "psycopg2",
- "mysql" : "MySQL_python"
-}
-
-def verify_tools( app, url, galaxy_config_file, engine_options={} ):
- # Check the value in the migrate_tools.version database table column to verify that the number is in
- # sync with the number of version scripts in ~/lib/galaxy/tools/migrate/versions.
- dialect = ( 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 )
- # Create engine and metadata
- engine = create_engine( url, **engine_options )
- meta = MetaData( bind=engine )
- # The migrate_tools table was created in database version script 0092_add_migrate_tools_table.py.
- version_table = Table( "migrate_tools", meta, autoload=True )
- # Verify that the code and the database are in sync.
- db_schema = schema.ControlledSchema( engine, migrate_repository )
- latest_tool_migration_script_number = migrate_repository.versions.latest
- if latest_tool_migration_script_number != db_schema.version:
- # The default behavior is that the tool shed is down.
- tool_shed_accessible = False
- if app.new_installation:
- # New installations will not be missing tools, so we don't need to worry about them.
- missing_tool_configs_dict = odict()
- else:
- tool_panel_configs = common_util.get_non_shed_tool_panel_configs( app )
- if tool_panel_configs:
- # The missing_tool_configs_dict contents are something like:
- # {'emboss_antigenic.xml': [('emboss', '5.0.0', 'package', '\nreadme blah blah blah\n')]}
- tool_shed_accessible, missing_tool_configs_dict = common_util.check_for_missing_tools( app, tool_panel_configs, latest_tool_migration_script_number )
- else:
- # It doesn't matter if the tool shed is accessible since there are no migrated tools defined in the local Galaxy instance, but
- # we have to set the value of tool_shed_accessible to True so that the value of migrate_tools.version can be correctly set in
- # the database.
- tool_shed_accessible = True
- missing_tool_configs_dict = odict()
- have_tool_dependencies = False
- for k, v in missing_tool_configs_dict.items():
- if v:
- have_tool_dependencies = True
- break
- config_arg = ''
- if os.path.abspath( os.path.join( os.getcwd(), 'universe_wsgi.ini' ) ) != galaxy_config_file:
- config_arg = ' -c %s' % galaxy_config_file.replace( os.path.abspath( os.getcwd() ), '.' )
- if not app.config.running_functional_tests:
- if tool_shed_accessible:
- # Automatically update the value of the migrate_tools.version database table column.
- cmd = 'sh manage_tools.sh%s upgrade' % config_arg
- proc = subprocess.Popen( args=cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
- return_code = proc.wait()
- output = proc.stdout.read( 32768 )
- if return_code != 0:
- raise Exception( "Error attempting to update the value of migrate_tools.version: %s" % output )
- elif missing_tool_configs_dict:
- if len( tool_panel_configs ) == 1:
- plural = ''
- tool_panel_config_file_names = tool_panel_configs[ 0 ]
- else:
- plural = 's'
- tool_panel_config_file_names = ', '.join( tool_panel_configs )
- msg = "\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
- msg += "\n\nThe list of files at the end of this message refers to tools that are configured to load into the tool panel for\n"
- msg += "this Galaxy instance, but have been removed from the Galaxy distribution. These tools and their dependencies can be\n"
- msg += "automatically installed from the Galaxy tool shed at http://toolshed.g2.bx.psu.edu.\n\n"
- msg += "To skip this process, attempt to start your Galaxy server again (e.g., sh run.sh or whatever you use). If you do this,\n"
- msg += "be aware that these tools will no longer be available in your Galaxy tool panel, and entries for each of them should\n"
- msg += "be removed from your file%s named %s.\n\n" % ( plural, tool_panel_config_file_names )
- msg += "CRITICAL NOTE IF YOU PLAN TO INSTALL\n"
- msg += "The location in which the tool repositories will be installed is the value of the 'tool_path' attribute in the <tool>\n"
- msg += 'tag of the file named ./migrated_tool_conf.xml (i.e., <toolbox tool_path="../shed_tools">). The default location\n'
- msg += "setting is '../shed_tools', which may be problematic for some cluster environments, so make sure to change it before\n"
- msg += "you execute the installation process if appropriate. The configured location must be outside of the Galaxy installation\n"
- msg += "directory or it must be in a sub-directory protected by a properly configured .hgignore file if the directory is within\n"
- msg += "the Galaxy installation directory hierarchy. This is because tool shed repositories will be installed using mercurial's\n"
- msg += "clone feature, which creates .hg directories and associated mercurial repository files. Not having .hgignore properly\n"
- msg += "configured could result in undesired behavior when modifying or updating your local Galaxy instance or the tool shed\n"
- msg += "repositories if they are in directories that pose conflicts. See mercurial's .hgignore documentation at the following\n"
- msg += "URL for details.\n\nhttp://mercurial.selenic.com/wiki/.hgignore\n\n"
- if have_tool_dependencies:
- msg += "The following tool dependencies can also optionally be installed (see the option flag in the command below). If you\n"
- msg += "choose to install them (recommended), they will be installed within the location specified by the 'tool_dependency_dir'\n"
- msg += "setting in your main Galaxy configuration file (e.g., uninverse_wsgi.ini).\n"
- processed_tool_dependencies = []
- for missing_tool_config, tool_dependencies in missing_tool_configs_dict.items():
- for tool_dependencies_tup in tool_dependencies:
- if tool_dependencies_tup not in processed_tool_dependencies:
- msg += "------------------------------------\n"
- msg += "Tool Dependency\n"
- msg += "------------------------------------\n"
- msg += "Name: %s, Version: %s, Type: %s\n" % ( tool_dependencies_tup[ 0 ],
- tool_dependencies_tup[ 1 ],
- tool_dependencies_tup[ 2 ] )
- if tool_dependencies_tup[ 3 ]:
- msg += "Requirements and installation information:\n"
- msg += "%s\n" % tool_dependencies_tup[ 3 ]
- else:
- msg += "\n"
- msg += "------------------------------------\n"
- processed_tool_dependencies.append( tool_dependencies_tup )
- msg += "\n"
- msg += "%s" % output.replace( 'done', '' )
- msg += "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"
- msg += "sh ./scripts/migrate_tools/%04d_tools.sh\n" % latest_tool_migration_script_number
- msg += "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"
- if have_tool_dependencies:
- msg += "The tool dependencies listed above will be installed along with the repositories if you add the 'install_dependencies'\n"
- msg += "option to the above command like this:\n\n"
- msg += "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n"
- msg += "sh ./scripts/migrate_tools/%04d_tools.sh install_dependencies\n" % latest_tool_migration_script_number
- msg += "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"
- msg += "Tool dependencies can be installed after the repositories have been installed as well.\n\n"
- msg += "After the installation process finishes, you can start your Galaxy server. As part of this installation process,\n"
- msg += "entries for each of the following tool config files will be added to the file named ./migrated_tool_conf.xml, so these\n"
- msg += "tools will continue to be loaded into your tool panel. Because of this, existing entries for these files should be\n"
- msg += "removed from your file%s named %s, but only after the installation process finishes.\n\n" % ( plural, tool_panel_config_file_names )
- for missing_tool_config, tool_dependencies in missing_tool_configs_dict.items():
- msg += "%s\n" % missing_tool_config
- msg += "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"
- raise Exception( msg )
- else:
- log.debug( "The main Galaxy tool shed is not currently available, so skipped tool migration %s until next server startup" % db_schema.version )
- else:
- log.info( "At migrate_tools version %d" % db_schema.version )
-
-def migrate_to_current_version( engine, schema ):
- # Changes to get to current version.
- changeset = schema.changeset( None )
- for ver, change in changeset:
- nextver = ver + changeset.step
- log.info( 'Installing tools from version %s -> %s... ' % ( ver, nextver ) )
- old_stdout = sys.stdout
- class FakeStdout( object ):
- def __init__( self ):
- self.buffer = []
- def write( self, s ):
- self.buffer.append( s )
- def flush( self ):
- pass
- sys.stdout = FakeStdout()
- try:
- schema.runchange( ver, change, changeset.step )
- finally:
- for message in "".join( sys.stdout.buffer ).split( "\n" ):
- log.info( message )
- sys.stdout = old_stdout
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/common.py
--- a/lib/galaxy/tool_shed/migrate/common.py
+++ /dev/null
@@ -1,81 +0,0 @@
-import sys, os, ConfigParser
-import galaxy.config
-import galaxy.datatypes.registry
-from galaxy import tools
-from galaxy.tools.data import *
-import galaxy.model.mapping
-import galaxy.tools.search
-from galaxy.objectstore import build_object_store_from_config
-from galaxy.tool_shed.common_util import *
-import galaxy.tool_shed.tool_shed_registry
-from galaxy.tool_shed import install_manager
-
-class MigrateToolsApplication( object ):
- """Encapsulates the state of a basic Galaxy Universe application in order to initiate the Install Manager"""
- def __init__( self, tools_migration_config ):
- install_dependencies = 'install_dependencies' in sys.argv
- galaxy_config_file = 'universe_wsgi.ini'
- if '-c' in sys.argv:
- pos = sys.argv.index( '-c' )
- sys.argv.pop( pos )
- galaxy_config_file = sys.argv.pop( pos )
- if not os.path.exists( galaxy_config_file ):
- print "Galaxy config file does not exist (hint: use '-c config.ini' for non-standard locations): %s" % galaxy_config_file
- sys.exit( 1 )
- config_parser = ConfigParser.ConfigParser( { 'here':os.getcwd() } )
- config_parser.read( galaxy_config_file )
- galaxy_config_dict = {}
- for key, value in config_parser.items( "app:main" ):
- galaxy_config_dict[ key ] = value
- self.config = galaxy.config.Configuration( **galaxy_config_dict )
- if not self.config.database_connection:
- self.config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
- self.config.update_integrated_tool_panel = True
- self.object_store = build_object_store_from_config( self.config )
- # Setup the database engine and ORM
- self.model = galaxy.model.mapping.init( self.config.file_path,
- self.config.database_connection,
- engine_options={},
- create_tables=False,
- object_store=self.object_store )
- # Create an empty datatypes registry.
- self.datatypes_registry = galaxy.datatypes.registry.Registry()
- # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config.
- self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
- # Initialize tool data tables using the config defined by self.config.tool_data_table_config_path.
- self.tool_data_tables = ToolDataTableManager( tool_data_path=self.config.tool_data_path,
- config_filename=self.config.tool_data_table_config_path )
- # Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
- self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config,
- tool_data_path=self.tool_data_tables.tool_data_path,
- from_shed_config=True )
- # Initialize the tools, making sure the list of tool configs includes the reserved migrated_tools_conf.xml file.
- tool_configs = self.config.tool_configs
- if self.config.migrated_tools_config not in tool_configs:
- tool_configs.append( self.config.migrated_tools_config )
- self.toolbox = tools.ToolBox( tool_configs, self.config.tool_path, self )
- # Search support for tools
- self.toolbox_search = galaxy.tools.search.ToolBoxSearch( self.toolbox )
- # Set up the tool sheds registry.
- if os.path.isfile( self.config.tool_sheds_config ):
- self.tool_shed_registry = galaxy.tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
- else:
- self.tool_shed_registry = None
- # Get the latest tool migration script number to send to the Install manager.
- latest_migration_script_number = int( tools_migration_config.split( '_' )[ 0 ] )
- # The value of migrated_tools_config is migrated_tools_conf.xml, and is reserved for containing only those tools that have been
- # eliminated from the distribution and moved to the tool shed. A side-effect of instantiating the InstallManager is the automatic
- # installation of all appropriate tool shed repositories.
- self.install_manager = install_manager.InstallManager( app=self,
- latest_migration_script_number=latest_migration_script_number,
- tool_shed_install_config=os.path.join( self.config.root,
- 'scripts',
- 'migrate_tools',
- tools_migration_config ),
- migrated_tools_config=self.config.migrated_tools_config,
- install_dependencies=install_dependencies )
- @property
- def sa_session( self ):
- return self.model.context.current
- def shutdown( self ):
- self.object_store.shutdown()
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/migrate.cfg
--- a/lib/galaxy/tool_shed/migrate/migrate.cfg
+++ /dev/null
@@ -1,20 +0,0 @@
-[db_settings]
-# Used to identify which repository this database is versioned under.
-# You can use the name of your project.
-repository_id=GalaxyTools
-
-# The name of the database table used to track the schema version.
-# This name shouldn't already be used by your project.
-# If this is changed once a database is under version control, you'll need to
-# change the table name in each database too.
-version_table=migrate_tools
-
-# When committing a change script, Migrate will attempt to generate the
-# sql for all supported databases; normally, if one of them fails - probably
-# because you don't have that database installed - it is ignored and the
-# commit continues, perhaps ending successfully.
-# Databases in this list MUST compile successfully during a commit, or the
-# entire commit will fail. List the databases your application will actually
-# be using to ensure your updates to that database work properly.
-# This must be a list; example: ['postgres','sqlite']
-required_dbs=[]
\ No newline at end of file
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0001_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0001_tools.py
+++ /dev/null
@@ -1,9 +0,0 @@
-"""
-Initialize the version column of the migrate_tools database table to 1. No tool migrations are handled in this version.
-"""
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0002_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0002_tools.py
+++ /dev/null
@@ -1,13 +0,0 @@
-"""
-The Emboss 5.0.0 tools have been eliminated from the distribution and the Emboss datatypes have been removed from
-datatypes_conf.xml.sample. You should remove the Emboss datatypes from your version of datatypes_conf.xml. The
-repositories named emboss_5 and emboss_datatypes from the main Galaxy tool shed at http://toolshed.g2.bx.psu.edu
-will be installed into your local Galaxy instance at the location discussed above by running the following command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0003_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0003_tools.py
+++ /dev/null
@@ -1,12 +0,0 @@
-"""
-The freebayes tool has been eliminated from the distribution . The repository named freebayes from the main
-Galaxy tool shed at http://toolshed.g2.bx.psu.edu will be installed into your local Galaxy instance at the
-location discussed above by running the following command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0004_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0004_tools.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""
-The NCBI BLAST+ tools have been eliminated from the distribution. The tools and
-datatypes are now available in repositories named ncbi_blast_plus and
-blast_datatypes, in the main Galaxy tool shed at http://toolshed.g2.bx.psu.edu.
-These repositories will be installed into your local Galaxy instance at the
-location discussed above by running the following command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0005_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0005_tools.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-The tools "Map with BWA for Illumina" and "Map with BWA for SOLiD" have
-been eliminated from the distribution. The tools are now available
-in the repository named bwa_wrappers from the main Galaxy tool shed at
-http://toolshed.g2.bx.psu.edu, and will be installed into your local
-Galaxy instance at the location discussed above by running the following
-command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0006_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0006_tools.py
+++ /dev/null
@@ -1,20 +0,0 @@
-"""
-The following tools have been eliminated from the distribution:
-FASTQ to BAM, SAM to FASTQ, BAM Index Statistics, Estimate Library
-Complexity, Insertion size metrics for PAIRED data, SAM/BAM Hybrid
-Selection Metrics, bam/sam Cleaning, Add or Replace Groups, Replace
-SAM/BAM Header, Paired Read Mate Fixer, Mark Duplicate reads,
-SAM/BAM Alignment Summary Metrics, SAM/BAM GC Bias Metrics, and
-Reorder SAM/BAM. The tools are now available in the repository
-named picard from the main Galaxy tool shed at
-http://toolshed.g2.bx.psu.edu, and will be installed into your
-local Galaxy instance at the location discussed above by running
-the following command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/migrate/versions/0007_tools.py
--- a/lib/galaxy/tool_shed/migrate/versions/0007_tools.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""
-The following tools have been eliminated from the distribution:
-Map with Bowtie for Illumina, Map with Bowtie for SOLiD, Lastz,
-and Lastz paired reads. The tools are now available in the
-repositories named bowtie_wrappers, bowtie_color_wrappers, lastz,
-and lastz_paired_reads from the main Galaxy tool shed at
-http://toolshed.g2.bx.psu.edu, and will be installed into your
-local Galaxy instance at the location discussed above by running
-the following command.
-"""
-
-import sys
-
-def upgrade():
- print __doc__
-def downgrade():
- pass
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/tool_dependencies/common_util.py
--- a/lib/galaxy/tool_shed/tool_dependencies/common_util.py
+++ /dev/null
@@ -1,149 +0,0 @@
-import os, shutil, tarfile, urllib2, zipfile
-from galaxy.datatypes import checkers
-
-def create_env_var_dict( elem, tool_dependency_install_dir=None, tool_shed_repository_install_dir=None ):
- env_var_name = elem.get( 'name', 'PATH' )
- env_var_action = elem.get( 'action', 'prepend_to' )
- env_var_text = None
- if elem.text and elem.text.find( 'REPOSITORY_INSTALL_DIR' ) >= 0:
- if tool_shed_repository_install_dir and elem.text.find( '$REPOSITORY_INSTALL_DIR' ) != -1:
- env_var_text = elem.text.replace( '$REPOSITORY_INSTALL_DIR', tool_shed_repository_install_dir )
- return dict( name=env_var_name, action=env_var_action, value=env_var_text )
- else:
- env_var_text = elem.text.replace( '$REPOSITORY_INSTALL_DIR', tool_dependency_install_dir )
- return dict( name=env_var_name, action=env_var_action, value=env_var_text )
- if elem.text and elem.text.find( 'INSTALL_DIR' ) >= 0:
- if tool_dependency_install_dir:
- env_var_text = elem.text.replace( '$INSTALL_DIR', tool_dependency_install_dir )
- return dict( name=env_var_name, action=env_var_action, value=env_var_text )
- else:
- env_var_text = elem.text.replace( '$INSTALL_DIR', tool_shed_repository_install_dir )
- return dict( name=env_var_name, action=env_var_action, value=env_var_text )
- if elem.text:
- # Allow for environment variables that contain neither REPOSITORY_INSTALL_DIR nor INSTALL_DIR since there may be command line
- # parameters that are tuned for a Galaxy instance. Allowing them to be set in one location rather than being hard coded into
- # each tool config is the best approach. For example:
- # <environment_variable name="GATK2_SITE_OPTIONS" action="set_to">
- # "--num_threads 4 --num_cpu_threads_per_data_thread 3 --phone_home STANDARD"
- # </environment_variable>
- return dict( name=env_var_name, action=env_var_action, value=elem.text)
- return None
-def create_or_update_env_shell_file( install_dir, env_var_dict ):
- env_var_name = env_var_dict[ 'name' ]
- env_var_action = env_var_dict[ 'action' ]
- env_var_value = env_var_dict[ 'value' ]
- if env_var_action == 'prepend_to':
- changed_value = '%s:$%s' % ( env_var_value, env_var_name )
- elif env_var_action == 'set_to':
- changed_value = '%s' % env_var_value
- elif env_var_action == 'append_to':
- changed_value = '$%s:%s' % ( env_var_name, env_var_value )
- env_shell_file_path = '%s/env.sh' % install_dir
- if os.path.exists( env_shell_file_path ):
- write_action = '>>'
- else:
- write_action = '>'
- cmd = "echo '%s=%s; export %s' %s %s;chmod +x %s" % ( env_var_name,
- changed_value,
- env_var_name,
- write_action,
- env_shell_file_path,
- env_shell_file_path )
- return cmd
-def extract_tar( file_name, file_path ):
- if isgzip( file_name ) or isbz2( file_name ):
- # Open for reading with transparent compression.
- tar = tarfile.open( file_name, 'r:*' )
- else:
- tar = tarfile.open( file_name )
- tar.extractall( path=file_path )
- tar.close()
-def extract_zip( archive_path, extraction_path ):
- # TODO: change this method to use zipfile.Zipfile.extractall() when we stop supporting Python 2.5.
- if not zipfile_ok( archive_path ):
- return False
- zip_archive = zipfile.ZipFile( archive_path, 'r' )
- for name in zip_archive.namelist():
- uncompressed_path = os.path.join( extraction_path, name )
- if uncompressed_path.endswith( '/' ):
- if not os.path.isdir( uncompressed_path ):
- os.makedirs( uncompressed_path )
- else:
- file( uncompressed_path, 'wb' ).write( zip_archive.read( name ) )
- zip_archive.close()
- return True
-def isbz2( file_path ):
- return checkers.is_bz2( file_path )
-def isgzip( file_path ):
- return checkers.is_gzip( file_path )
-def istar( file_path ):
- return tarfile.is_tarfile( file_path )
-def iszip( file_path ):
- return checkers.check_zip( file_path )
-def make_directory( full_path ):
- if not os.path.exists( full_path ):
- os.makedirs( full_path )
-def move_directory_files( current_dir, source_dir, destination_dir ):
- source_directory = os.path.abspath( os.path.join( current_dir, source_dir ) )
- destination_directory = os.path.join( destination_dir )
- if not os.path.isdir( destination_directory ):
- os.makedirs( destination_directory )
- for file_name in os.listdir( source_directory ):
- source_file = os.path.join( source_directory, file_name )
- destination_file = os.path.join( destination_directory, file_name )
- shutil.move( source_file, destination_file )
-def move_file( current_dir, source, destination_dir ):
- source_file = os.path.abspath( os.path.join( current_dir, source ) )
- destination_directory = os.path.join( destination_dir )
- if not os.path.isdir( destination_directory ):
- os.makedirs( destination_directory )
- shutil.move( source_file, destination_directory )
-def tar_extraction_directory( file_path, file_name ):
- """Try to return the correct extraction directory."""
- file_name = file_name.strip()
- extensions = [ '.tar.gz', '.tgz', '.tar.bz2', '.tar', '.zip' ]
- for extension in extensions:
- if file_name.find( extension ) > 0:
- dir_name = file_name[ :-len( extension ) ]
- if os.path.exists( os.path.abspath( os.path.join( file_path, dir_name ) ) ):
- return dir_name
- if os.path.exists( os.path.abspath( os.path.join( file_path, file_name ) ) ):
- return os.path.abspath( file_path )
- raise ValueError( 'Could not find path to file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) )
-def url_download( install_dir, downloaded_file_name, download_url ):
- file_path = os.path.join( install_dir, downloaded_file_name )
- src = None
- dst = None
- try:
- src = urllib2.urlopen( download_url )
- data = src.read()
- dst = open( file_path,'wb' )
- dst.write( data )
- except:
- if src:
- src.close()
- if dst:
- dst.close()
- return os.path.abspath( file_path )
-def zip_extraction_directory( file_path, file_name ):
- """Try to return the correct extraction directory."""
- files = [ filename for filename in os.listdir( file_path ) if not filename.endswith( '.zip' ) ]
- if len( files ) > 1:
- return os.path.abspath( file_path )
- elif len( files ) == 1:
- # If there is only on file it should be a directory.
- if os.path.isdir( os.path.join( file_path, files[ 0 ] ) ):
- return os.path.abspath( os.path.join( file_path, files[ 0 ] ) )
- raise ValueError( 'Could not find directory for the extracted file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) )
-def zipfile_ok( path_to_archive ):
- """
- This function is a bit pedantic and not functionally necessary. It checks whether there is no file pointing outside of the extraction,
- because ZipFile.extractall() has some potential security holes. See python zipfile documentation for more details.
- """
- basename = os.path.realpath( os.path.dirname( path_to_archive ) )
- zip_archive = zipfile.ZipFile( path_to_archive )
- for member in zip_archive.namelist():
- member_path = os.path.realpath( os.path.join( basename, member ) )
- if not member_path.startswith( basename ):
- return False
- return True
diff -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 -r 6f0050c4e06ef6f5fdce3f7326280c07c63ef62e lib/galaxy/tool_shed/tool_dependencies/fabric_util.py
--- a/lib/galaxy/tool_shed/tool_dependencies/fabric_util.py
+++ /dev/null
@@ -1,143 +0,0 @@
-# For Python 2.5
-from __future__ import with_statement
-
-import os, shutil, tempfile
-from contextlib import contextmanager
-import common_util
-
-from galaxy import eggs
-import pkg_resources
-
-pkg_resources.require('ssh' )
-pkg_resources.require( 'Fabric' )
-
-from fabric.api import env, lcd, local, settings
-
-INSTALLATION_LOG = 'INSTALLATION.log'
-
-def check_fabric_version():
- version = env.version
- if int( version.split( "." )[ 0 ] ) < 1:
- raise NotImplementedError( "Install Fabric version 1.0 or later." )
-def set_galaxy_environment( galaxy_user, tool_dependency_dir, host='localhost', shell='/bin/bash -l -c' ):
- """General Galaxy environment configuration"""
- env.user = galaxy_user
- env.install_dir = tool_dependency_dir
- env.host_string = host
- env.shell = shell
- env.use_sudo = False
- env.safe_cmd = local
- return env
-@contextmanager
-def make_tmp_dir():
- work_dir = tempfile.mkdtemp()
- yield work_dir
- if os.path.exists( work_dir ):
- local( 'rm -rf %s' % work_dir )
-def handle_command( app, tool_dependency, install_dir, cmd ):
- sa_session = app.model.context.current
- output = local( cmd, capture=True )
- log_results( cmd, output, os.path.join( install_dir, INSTALLATION_LOG ) )
- if output.return_code:
- tool_dependency.status = app.model.ToolDependency.installation_status.ERROR
- tool_dependency.error_message = str( output.stderr )
- sa_session.add( tool_dependency )
- sa_session.flush()
- return output.return_code
-def install_and_build_package( app, tool_dependency, actions_dict ):
- """Install a Galaxy tool dependency package either via a url or a mercurial or git clone command."""
- sa_session = app.model.context.current
- install_dir = actions_dict[ 'install_dir' ]
- package_name = actions_dict[ 'package_name' ]
- actions = actions_dict.get( 'actions', None )
- filtered_actions = []
- if actions:
- with make_tmp_dir() as work_dir:
- with lcd( work_dir ):
- # The first action in the list of actions will be the one that defines the installation process. There
- # are currently only two supported processes; download_by_url and clone via a "shell_command" action type.
- action_type, action_dict = actions[ 0 ]
- if action_type == 'download_by_url':
- # Eliminate the download_by_url action so remaining actions can be processed correctly.
- filtered_actions = actions[ 1: ]
- url = action_dict[ 'url' ]
- if 'target_filename' in action_dict:
- downloaded_filename = action_dict[ 'target_filename' ]
- else:
- downloaded_filename = os.path.split( url )[ -1 ]
- downloaded_file_path = common_util.url_download( work_dir, downloaded_filename, url )
- if common_util.istar( downloaded_file_path ):
- # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1…</action>
- common_util.extract_tar( downloaded_file_path, work_dir )
- dir = common_util.tar_extraction_directory( work_dir, downloaded_filename )
- elif common_util.iszip( downloaded_file_path ):
- # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-to…</action>
- zip_archive_extracted = common_util.extract_zip( downloaded_file_path, work_dir )
- dir = common_util.zip_extraction_directory( work_dir, downloaded_filename )
- else:
- dir = work_dir
- elif action_type == 'shell_command':
- # <action type="shell_command">git clone --recursive git://github.com/ekg/freebayes.git</action>
- # Eliminate the shell_command clone action so remaining actions can be processed correctly.
- filtered_actions = actions[ 1: ]
- return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
- if return_code:
- return
- dir = package_name
- else:
- # We're handling a complex repository dependency where we only have a set_environment tag set.
- # <action type="set_environment">
- # <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
- # </action>
- filtered_actions = [ a for a in actions ]
- dir = install_dir
- if not os.path.exists( dir ):
- os.makedirs( dir )
- # The package has been down-loaded, so we can now perform all of the actions defined for building it.
- with lcd( dir ):
- for action_tup in filtered_actions:
- action_type, action_dict = action_tup
- current_dir = os.path.abspath( os.path.join( work_dir, dir ) )
- if action_type == 'make_directory':
- common_util.make_directory( full_path=action_dict[ 'full_path' ] )
- elif action_type == 'move_directory_files':
- common_util.move_directory_files( current_dir=current_dir,
- source_dir=os.path.join( action_dict[ 'source_directory' ] ),
- destination_dir=os.path.join( action_dict[ 'destination_directory' ] ) )
- elif action_type == 'move_file':
- # TODO: Remove this hack that resets current_dir so that the pre-compiled bwa binary can be found.
- # current_dir = '/Users/gvk/workspaces_2008/bwa/bwa-0.5.9'
- common_util.move_file( current_dir=current_dir,
- source=os.path.join( action_dict[ 'source' ] ),
- destination_dir=os.path.join( action_dict[ 'destination' ] ) )
- elif action_type == 'set_environment':
- # Currently the only action supported in this category is "environment_variable".
- env_var_dicts = action_dict[ 'environment_variable' ]
- for env_var_dict in env_var_dicts:
- cmd = common_util.create_or_update_env_shell_file( install_dir, env_var_dict )
- return_code = handle_command( app, tool_dependency, install_dir, cmd )
- if return_code:
- return
- elif action_type == 'shell_command':
- with settings( warn_only=True ):
- return_code = handle_command( app, tool_dependency, install_dir, action_dict[ 'command' ] )
- if return_code:
- return
-def log_results( command, fabric_AttributeString, file_path ):
- """
- Write attributes of fabric.operations._AttributeString (which is the output of executing command using fabric's local() method)
- to a specified log file.
- """
- if os.path.exists( file_path ):
- logfile = open( file_path, 'ab' )
- else:
- logfile = open( file_path, 'wb' )
- logfile.write( "\n#############################################\n" )
- logfile.write( '%s\nSTDOUT\n' % command )
- logfile.write( str( fabric_AttributeString.stdout ) )
- logfile.write( "\n#############################################\n" )
- logfile.write( "\n#############################################\n" )
- logfile.write( '%s\nSTDERR\n' % command )
- logfile.write( str( fabric_AttributeString.stderr ) )
- logfile.write( "\n#############################################\n" )
- logfile.close()
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: natefoo: Python 2.5 compatibility fix for lwr client updates.
by commits-noreply@bitbucket.org 26 Feb '13
by commits-noreply@bitbucket.org 26 Feb '13
26 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e9e09d1ab517/
changeset: e9e09d1ab517
user: natefoo
date: 2013-02-26 15:33:31
summary: Python 2.5 compatibility fix for lwr client updates.
affected #: 1 file
diff -r 993c232d34cda550a5605f87d7416467d4e2c33f -r e9e09d1ab51752db592eee71032ec5fc33f6ee57 lib/galaxy/jobs/runners/lwr_client/transport/standard.py
--- a/lib/galaxy/jobs/runners/lwr_client/transport/standard.py
+++ b/lib/galaxy/jobs/runners/lwr_client/transport/standard.py
@@ -1,6 +1,7 @@
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
+from __future__ import with_statement
import mmap
import urllib2
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0