1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/34f61e53a563/ changeset: 34f61e53a563 user: greg date: 2012-12-13 18:00:53 summary: More import tweaks. affected #: 6 files
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/tool_shed/install_manager.py --- a/lib/galaxy/tool_shed/install_manager.py +++ b/lib/galaxy/tool_shed/install_manager.py @@ -2,13 +2,14 @@ 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 urllib2, tempfile +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.common_util import * +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 ): @@ -37,17 +38,17 @@ tree = util.parse_xml( tool_shed_install_config ) root = tree.getroot() self.tool_shed = shed_util.clean_tool_shed_url( root.get( 'name' ) ) - self.repository_owner = REPOSITORY_OWNER + self.repository_owner = common_util.REPOSITORY_OWNER index, self.shed_config_dict = shed_util.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 = get_non_shed_tool_panel_configs( app ) + 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 = check_for_missing_tools( app, tool_panel_configs, latest_migration_script_number ) + 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 @@ -112,7 +113,7 @@ # Tools outside of sections. file_path = elem.get( 'file', None ) if file_path: - name = strip_path( 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 ) @@ -122,7 +123,7 @@ if section_elem.tag == 'tool': file_path = section_elem.get( 'file', None ) if file_path: - name = strip_path( 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: @@ -139,7 +140,7 @@ 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 = strip_path( proprietary_tool_config ) + 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 ) @@ -151,7 +152,7 @@ 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 = strip_path( proprietary_tool_config ) + 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 ) ) @@ -349,7 +350,7 @@ 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 get_non_shed_tool_panel_configs( self.app ) + 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/
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/tool_shed/migrate/check.py --- a/lib/galaxy/tool_shed/migrate/check.py +++ b/lib/galaxy/tool_shed/migrate/check.py @@ -6,6 +6,7 @@ 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__ )
@@ -48,11 +49,11 @@ # 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 = get_non_shed_tool_panel_configs( app ) + 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 = check_for_missing_tools( app, tool_panel_configs, latest_tool_migration_script_number ) + 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
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -32,7 +32,7 @@ from cgi import FieldStorage from galaxy.util.hash_util import * from galaxy.util import listify -import galaxy.util.shed_util as shed_util +import galaxy.util.shed_util from galaxy.web import url_for
from galaxy.visualization.genome.visual_analytics import TracksterConfig @@ -887,11 +887,11 @@ def tool_shed_repository( self ): # If this tool is included in an installed tool shed repository, return it. if self.tool_shed: - return shed_util.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.app, - self.tool_shed, - self.repository_name, - self.repository_owner, - self.installed_changeset_revision ) + return galaxy.util.shed_util.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.app, + self.tool_shed, + self.repository_name, + self.repository_owner, + self.installed_changeset_revision ) return None def __get_job_run_config( self, run_configs, key, job_params=None ): # Look through runners/handlers to find one with matching parameters.
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -393,7 +393,7 @@ for tool_dict in metadata[ 'tools' ]: guid = tool_dict[ 'guid' ] tool_config = tool_dict[ 'tool_config' ] - file_name = strip_path( tool_config ) + file_name = suc.strip_path( tool_config ) guids_and_configs[ guid ] = file_name # Parse the shed_tool_conf file in which all of this repository's tools are defined and generate the tool_panel_dict. tree = util.parse_xml( shed_tool_conf ) @@ -434,7 +434,7 @@ {<Tool guid> : [{ tool_config : <tool_config_file>, id: <ToolSection id>, version : <ToolSection version>, name : <TooSection name>}]} """ tool_panel_dict = {} - file_name = strip_path( tool_config ) + file_name = suc.strip_path( tool_config ) tool_section_dicts = generate_tool_section_dicts( tool_config=file_name, tool_sections=tool_sections ) tool_panel_dict[ guid ] = tool_section_dicts return tool_panel_dict @@ -471,11 +471,11 @@ return tool_section def get_config( config_file, repo, ctx, dir ): """Return the latest version of config_filename from the repository manifest.""" - config_file = strip_path( config_file ) + config_file = suc.strip_path( config_file ) for changeset in suc.reversed_upper_bounded_changelog( repo, ctx ): changeset_ctx = repo.changectx( changeset ) for ctx_file in changeset_ctx.files(): - ctx_file_name = strip_path( ctx_file ) + ctx_file_name = suc.strip_path( ctx_file ) if ctx_file_name == config_file: return suc.get_named_tmpfile_from_ctx( changeset_ctx, ctx_file, dir ) return None @@ -491,7 +491,7 @@ for converter in elem.findall( 'converter' ): converter_config = converter.get( 'file', None ) if converter_config: - converter_config_file_name = strip_path( converter_config ) + converter_config_file_name = suc.strip_path( converter_config ) for root, dirs, files in os.walk( relative_install_dir ): if root.find( '.hg' ) < 0: for name in files: @@ -508,7 +508,7 @@ for display_app in elem.findall( 'display' ): display_config = display_app.get( 'file', None ) if display_config: - display_config_file_name = strip_path( display_config ) + display_config_file_name = suc.strip_path( display_config ) for root, dirs, files in os.walk( relative_install_dir ): if root.find( '.hg' ) < 0: for name in files: @@ -574,7 +574,7 @@ if shed_tool_conf == shed_tool_conf_dict[ 'config_filename' ]: return index, shed_tool_conf_dict else: - file_name = strip_path( shed_tool_conf_dict[ 'config_filename' ] ) + file_name = suc.strip_path( shed_tool_conf_dict[ 'config_filename' ] ) if shed_tool_conf == file_name: return index, shed_tool_conf_dict def get_tool_index_sample_files( sample_files ): @@ -722,11 +722,11 @@ params_with_missing_index_file = repository_tool.params_with_missing_index_file for param in params_with_missing_index_file: options = param.options - missing_file_name = strip_path( options.missing_index_file ) + missing_file_name = suc.strip_path( options.missing_index_file ) if missing_file_name not in sample_files_copied: # The repository must contain the required xxx.loc.sample file. for sample_file in sample_files: - sample_file_name = strip_path( sample_file ) + sample_file_name = suc.strip_path( sample_file ) if sample_file_name == '%s.sample' % missing_file_name: suc.copy_sample_file( app, sample_file ) if options.tool_data_table and options.tool_data_table.missing_index_file:
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -1316,7 +1316,7 @@ return suc.get_repository_file_contents( file_path ) def get_file_from_changeset_revision( self, repo_files_dir, changeset_revision, file_name, dir ): """Return file_name from the received changeset_revision of the repository manifest.""" - stripped_file_name = strip_path( file_name ) + stripped_file_name = suc.strip_path( file_name ) repo = hg.repository( suc.get_configured_ui(), repo_files_dir ) ctx = suc.get_changectx_for_changeset( repo, changeset_revision ) named_tmp_file = suc.get_named_tmpfile_from_ctx( ctx, file_name, dir )
diff -r b96fe1d76b383ef2a77ff76bdc6580362aab4f0d -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -1109,7 +1109,7 @@ tool_path = shed_tool_conf_dict[ 'tool_path' ] break else: - file_name = strip_path( config_filename ) + file_name = suc.strip_path( config_filename ) if file_name == shed_tool_conf: tool_path = shed_tool_conf_dict[ 'tool_path' ] break
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.
galaxy-commits@lists.galaxyproject.org