1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b397f2fe3e7c/ Changeset: b397f2fe3e7c User: greg Date: 2014-03-31 04:48:17 Summary: When multiple versions of the same tool are loaded into the Galaxy tool panel, make sure the newest version of the tool is displayed by default in the tool version select list on the tool form when it is initially loaded. Affected #: 2 files
diff -r 8aabd0a1acf8439553970fcbd5661f2ec8b34884 -r b397f2fe3e7c6350de924c2557a83bebd6301f8d lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -265,7 +265,7 @@ inserted = True if not inserted: # Check the tool's installed versions. - for lineage_id in tool.tool_version_ids: + for lineage_id in tool.lineage_ids: lineage_id_key = 'tool_%s' % lineage_id for index, integrated_panel_key in enumerate( self.integrated_tool_panel.keys() ): if lineage_id_key == integrated_panel_key: @@ -504,14 +504,15 @@
def get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=False ): """ - Retrieve all loaded versions of a tool from the toolbox and return a select list enabling selection of a different version, the list of the tool's - loaded versions, and the specified tool. + Retrieve all loaded versions of a tool from the toolbox and return a select list enabling + selection of a different version, the list of the tool's loaded versions, and the specified tool. """ toolbox = self tool_version_select_field = None tools = [] tool = None - # Backwards compatibility for datasource tools that have default tool_id configured, but which are now using only GALAXY_URL. + # Backwards compatibility for datasource tools that have default tool_id configured, but which + # are now using only GALAXY_URL. tool_ids = listify( tool_id ) for tool_id in tool_ids: if get_loaded_tools_by_lineage: @@ -534,11 +535,11 @@ refresh_on_change_values.append( tool.id ) select_field = SelectField( name='tool_id', refresh_on_change=True, refresh_on_change_values=refresh_on_change_values ) for option_tup in options: - selected = set_selected and option_tup[1] == tool_id + selected = set_selected and option_tup[ 1 ] == tool_id if selected: - select_field.add_option( 'version %s' % option_tup[0], option_tup[1], selected=True ) + select_field.add_option( 'version %s' % option_tup[ 0 ], option_tup[ 1 ], selected=True ) else: - select_field.add_option( 'version %s' % option_tup[0], option_tup[1] ) + select_field.add_option( 'version %s' % option_tup[ 0 ], option_tup[ 1 ] ) return select_field
def load_tool_tag_set( self, elem, panel_dict, integrated_panel_dict, tool_path, load_panel_dict, guid=None, index=None ):
diff -r 8aabd0a1acf8439553970fcbd5661f2ec8b34884 -r b397f2fe3e7c6350de924c2557a83bebd6301f8d lib/galaxy/webapps/galaxy/controllers/tool_runner.py --- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py +++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py @@ -50,14 +50,19 @@ return self.get_toolbox().get_tool_components( tool_id, tool_version, get_loaded_tools_by_lineage, set_selected )
@web.expose - def index(self, trans, tool_id=None, from_noframe=None, **kwd): + def index( self, trans, tool_id=None, from_noframe=None, **kwd ): # No tool id passed, redirect to main page if tool_id is None: return trans.response.send_redirect( url_for( controller="root", action="welcome" ) ) + # When the tool form is initially loaded, the received kwd will not include a 'refresh' + # entry (which only is included when another option is selected in the tool_version_select_field), + # so the default selected option should be the most recent version of the tool. The following + # check will mae sure this occurs. + refreshed_on_change = kwd.get( 'refresh', False ) tool_version_select_field, tools, tool = self.__get_tool_components( tool_id, tool_version=None, get_loaded_tools_by_lineage=False, - set_selected=True ) + set_selected=refreshed_on_change ) # No tool matching the tool id, display an error (shouldn't happen) if not tool: log.error( "index called with tool id '%s' but no such tool exists", tool_id )
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.