commit/galaxy-central: greg: When getting updates to an installed tool shed repository that contains tools, automatically load any updated tools into the Galaxy tool panel.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/1d73c973c9ad/ changeset: 1d73c973c9ad user: greg date: 2012-12-13 23:13:40 summary: When getting updates to an installed tool shed repository that contains tools, automatically load any updated tools into the Galaxy tool panel. affected #: 3 files diff -r 97ec62934b6b17e674706f2c41ce4b34032fa338 -r 1d73c973c9adfa27e1759c280e94c712145e1e03 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -397,7 +397,7 @@ # If there is not yet a tool_shed_repository record, we're in the process of installing # a new repository, so any included tools can be loaded into the tool panel. can_load_into_panel_dict = True - tool = self.load_tool( os.path.join( tool_path, path ), guid=guid ) + tool = self.load_tool( os.path.join( tool_path, path ), guid=guid ) key = 'tool_%s' % str( tool.id ) if can_load_into_panel_dict: if guid is not None: @@ -435,9 +435,12 @@ tta = self.app.model.ToolTagAssociation( tool_id=tool.id, tag_id=tag.id ) self.sa_session.add( tta ) self.sa_session.flush() - if tool.id not in self.tools_by_id: - # Allow for the same tool to be loaded into multiple places in the tool panel. - self.tools_by_id[ tool.id ] = tool + #if tool.id not in self.tools_by_id: + # Allow for the same tool to be loaded into multiple places in the tool panel. We have to handle the case where the tool is contained + # in a repository installed from the tool shed, and the Galaxy administrator has retrieved updates to the installed repository. In this + # case, the tool may have been updated, but the version was not changed, so the tool should always be reloaded here. We used to only load + # the tool if it's it was not found in self.tools_by_id, but performing that check did not enable this scenario. + self.tools_by_id[ tool.id ] = tool if load_panel_dict: self.__add_tool_to_tool_panel( tool.id, panel_dict, section=isinstance( panel_dict, galaxy.tools.ToolSection ) ) # Always load the tool into the integrated_panel_dict, or it will not be included in the integrated_tool_panel.xml file. diff -r 97ec62934b6b17e674706f2c41ce4b34032fa338 -r 1d73c973c9adfa27e1759c280e94c712145e1e03 lib/galaxy/util/shed_util_common.py --- a/lib/galaxy/util/shed_util_common.py +++ b/lib/galaxy/util/shed_util_common.py @@ -1036,7 +1036,7 @@ return metadata_dict def generate_tool_panel_dict_from_shed_tool_conf_entries( app, repository ): """ - Keep track of the section in the tool panel in which this repository's tools will be contained by parsing the shed-tool_conf in + Keep track of the section in the tool panel in which this repository's tools will be contained by parsing the shed_tool_conf in which the repository's tools are defined and storing the tool panel definition of each tool in the repository. This method is called only when the repository is being deactivated or uninstalled and allows for activation or reinstallation using the original layout. """ @@ -2232,8 +2232,10 @@ sa_session.flush() return new_tool_dependency def update_in_shed_tool_config( app, repository ): - # A tool shed repository is being updated so change the shed_tool_conf file. Parse the config file to generate the entire list - # of config_elems instead of using the in-memory list. + """ + A tool shed repository is being updated so change the shed_tool_conf file. Parse the config file to generate the entire list + of config_elems instead of using the in-memory list. + """ shed_conf_dict = repository.get_shed_config_dict( app ) shed_tool_conf = shed_conf_dict[ 'config_filename' ] tool_path = shed_conf_dict[ 'tool_path' ] diff -r 97ec62934b6b17e674706f2c41ce4b34032fa338 -r 1d73c973c9adfa27e1759c280e94c712145e1e03 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 @@ -327,7 +327,7 @@ shed_util.add_to_tool_panel( trans.app, repository.name, repository_clone_url, - repository.changeset_revision, + repository.installed_changeset_revision, repository_tools_tups, repository.owner, shed_tool_conf, @@ -810,7 +810,7 @@ shed_util.add_to_tool_panel( app=trans.app, repository_name=tool_shed_repository.name, repository_clone_url=repository_clone_url, - changeset_revision=tool_shed_repository.changeset_revision, + changeset_revision=tool_shed_repository.installed_changeset_revision, repository_tools_tups=repository_tools_tups, owner=tool_shed_repository.owner, shed_tool_conf=shed_tool_conf, @@ -1777,7 +1777,20 @@ repository.update_available = False trans.sa_session.add( repository ) trans.sa_session.flush() - # Fixme: call shed_util.add_to_tool_panel here? + if 'tools' in metadata_dict: + tool_panel_dict = metadata_dict.get( 'tool_panel_section', None ) + if tool_panel_dict is None: + tool_panel_dict = suc.generate_tool_panel_dict_from_shed_tool_conf_entries( trans.app, repository ) + repository_tools_tups = suc.get_repository_tools_tups( trans.app, metadata_dict ) + shed_util.add_to_tool_panel( app=trans.app, + repository_name=repository.name, + repository_clone_url=repository_clone_url, + changeset_revision=repository.installed_changeset_revision, + repository_tools_tups=repository_tools_tups, + owner=repository.owner, + shed_tool_conf=shed_tool_conf, + tool_panel_dict=tool_panel_dict, + new_install=False ) # Create tool_dependency records if necessary. if 'tool_dependencies' in metadata_dict: tool_dependencies = shed_util.create_tool_dependency_objects( trans.app, repository, relative_install_dir, set_status=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.
participants (1)
-
Bitbucket