commit/galaxy-central: greg: Improvements for populating the tool panel when installing a repository containing a version of a tool alreadly loaded in the tool panel.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3f349df2bb9c/ Changeset: 3f349df2bb9c User: greg Date: 2014-03-31 13:37:45 Summary: Improvements for populating the tool panel when installing a repository containing a version of a tool alreadly loaded in the tool panel. Affected #: 1 file diff -r b397f2fe3e7c6350de924c2557a83bebd6301f8d -r 3f349df2bb9cade82ea55ab4b3ed7f9ad473cdf5 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -63,8 +63,6 @@ from galaxy.web.form_builder import SelectField from galaxy.model.item_attrs import Dictifiable from galaxy.model import Workflow -from tool_shed.util import common_util -from tool_shed.util import encoding_util from tool_shed.util import shed_util_common as suc from .loader import load_tool, template_macro_params from .wrappers import ( @@ -283,41 +281,15 @@ panel_dict[ key ] = tool log.debug( "Loaded tool id: %s, version: %s into tool panel.." % ( tool.id, tool.version ) ) else: - # We are in the process of installing the tool. The version lineage chain will not yet be - # built on the Galaxy side, so we have to get it from the Tool Shed. - tool_shed_url = suc.get_url_from_tool_shed( self.app, str( tool.tool_shed ) ) - # get_versions_of_tool( self, trans, name, owner, changeset_revision, encoded_guid ) - params = '?name=%s&owner=%s&changeset_revision=%s&encoded_guid=%s' % \ - ( str( tool.repository_name ), - str( tool.repository_owner ), - str( tool.installed_changeset_revision ), - encoding_util.tool_shed_encode( tool.guid ) ) - url = suc.url_join( tool_shed_url, 'repository/get_versions_of_tool%s' % params ) - try: - # For backward compatibility - some versions of the Tool Shed will not have the - # get_versions_of_tool() method. - raw_text = common_util.tool_shed_get( self.app, tool_shed_url, url ) - tool_lineage_ids = json.loads( raw_text ) - except Exception, e: - log.exception( "Error with url\n%s\n%s" % ( str( url ), str( e ) ) ) - tool_lineage_ids = [] + # We are in the process of installing the tool. + tool_version = self.__get_tool_version( tool_id ) + tool_lineage_ids = tool_version.get_version_ids( self.app, reverse=True ) for lineage_id in tool_lineage_ids: if lineage_id in self.tools_by_id: loaded_version_key = 'tool_%s' % lineage_id if loaded_version_key in panel_dict: if not already_loaded: already_loaded = True - # Even though a version of the tool is loaded in the tool panel, we need to find out if it - # is the most recent version. - key = 'tool_%s' % tool.guid - index = panel_dict.keys().index( loaded_version_key ) - if loaded_version_key > key: - index = panel_dict.keys().index( loaded_version_key ) - del panel_dict[ loaded_version_key ] - panel_dict.insert( index, key, tool ) - log.debug( "Loaded tool id: %s, version: %s into tool panel..." % ( tool.id, tool.version ) ) - inserted = True - break if not already_loaded: # If the tool is not defined in integrated_tool_panel.xml, append it to the tool panel. panel_dict[ key ] = tool 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.
participants (1)
-
commits-noreply@bitbucket.org