commit/galaxy-central: dan: Fix for reinstalling a Tool Shed Repository that contains tools, but none of them are added to the tool panel.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/e882cfa616ec/ changeset: e882cfa616ec user: dan date: 2013-02-15 19:49:47 summary: Fix for reinstalling a Tool Shed Repository that contains tools, but none of them are added to the tool panel. affected #: 1 file diff -r 2664d904641abdc1ed6a2f972eb5aeefa8f93703 -r e882cfa616ec6a51ac75d7d7779d2aa7f2e516f8 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -1058,30 +1058,32 @@ tool_section = None tool_panel_section_key = None if 'tools' in metadata: - if 'tool_panel_section' in metadata: - tool_panel_dict = metadata[ 'tool_panel_section' ] - if not tool_panel_dict: + # This forces everything to be loaded into the same section (or no section) in the tool panel. + if no_changes_checked: + if 'tool_panel_section' in metadata: + tool_panel_dict = metadata[ 'tool_panel_section' ] + if not tool_panel_dict: + tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] ) + else: tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] ) - else: - tool_panel_dict = generate_tool_panel_dict_for_new_install( metadata[ 'tools' ] ) - # This forces everything to be loaded into the same section (or no section) in the tool panel. - tool_section_dicts = tool_panel_dict[ tool_panel_dict.keys()[ 0 ] ] - tool_section_dict = tool_section_dicts[ 0 ] - original_section_id = tool_section_dict[ 'id' ] - original_section_name = tool_section_dict[ 'name' ] - if no_changes_checked: - if original_section_id: - tool_panel_section_key = 'section_%s' % str( original_section_id ) - if tool_panel_section_key in trans.app.toolbox.tool_panel: - tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ] - else: - # The section in which the tool was originally loaded used to be in the tool panel, but no longer is. - elem = Element( 'section' ) - elem.attrib[ 'name' ] = original_section_name - elem.attrib[ 'id' ] = original_section_id - elem.attrib[ 'version' ] = '' - tool_section = galaxy.tools.ToolSection( elem ) - trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section + if tool_panel_dict: + #tool_panel_dict is empty when tools exist but are not installed into a tool panel + tool_section_dicts = tool_panel_dict[ tool_panel_dict.keys()[ 0 ] ] + tool_section_dict = tool_section_dicts[ 0 ] + original_section_id = tool_section_dict[ 'id' ] + original_section_name = tool_section_dict[ 'name' ] + if original_section_id: + tool_panel_section_key = 'section_%s' % str( original_section_id ) + if tool_panel_section_key in trans.app.toolbox.tool_panel: + tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ] + else: + # The section in which the tool was originally loaded used to be in the tool panel, but no longer is. + elem = Element( 'section' ) + elem.attrib[ 'name' ] = original_section_name + elem.attrib[ 'id' ] = original_section_id + elem.attrib[ 'version' ] = '' + tool_section = galaxy.tools.ToolSection( elem ) + trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section else: # The user elected to change the tool panel section to contain the tools. if new_tool_panel_section: 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