mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 15:45:04 +08:00
Load empty tool sections into the in-memory tool_panel dictionary, just don't display them in the tool panel. Also include a fix for reactivating or unintallting a tool shed repository that includes tools - ToolVersion ovjects cannot be marked deleted.
This commit is contained in:
@@ -295,7 +295,7 @@ class ToolBox( object ):
|
||||
self.load_workflow_tag_set( sub_elem, elems )
|
||||
elif sub_elem.tag == 'label':
|
||||
self.load_label_tag_set( sub_elem, elems )
|
||||
if key not in panel_dict and section.elems:
|
||||
if key not in panel_dict:
|
||||
panel_dict[ key ] = section
|
||||
def load_tool( self, config_file, guid=None ):
|
||||
"""
|
||||
|
||||
@@ -499,18 +499,9 @@ class AdminToolshed( AdminGalaxy ):
|
||||
metadata = repository.metadata
|
||||
repository_tools_tups = get_repository_tools_tups( trans.app, metadata )
|
||||
guids_to_activate = [ repository_tool_tup[1] for repository_tool_tup in repository_tools_tups ]
|
||||
# Undelete the tool_version for each guid.
|
||||
# Make sure we have a tool_version for each guid.
|
||||
for guid_to_activate in guids_to_activate:
|
||||
tool_version = get_tool_version( trans.app, guid_to_activate )
|
||||
if tool_version:
|
||||
if tool_version.deleted:
|
||||
# This should not happen as we are currently not marking tool versions as deleted
|
||||
# upon deactivation. We may decide to eliminate the tool_version.deleted column
|
||||
# at some point, but we'll keep it for now in case we decide its useful.
|
||||
tool_version.deleted = False
|
||||
trans.sa_session.add( tool_version )
|
||||
trans.sa_session.flush()
|
||||
else:
|
||||
if not get_tool_version( trans.app, guid_to_activate ):
|
||||
# We're somehow missing a tool_version, so create a new one.
|
||||
tool_version = trans.model.ToolVersion( tool_id=guid_to_activate, tool_shed_repository=repository )
|
||||
trans.sa_session.add( tool_version )
|
||||
|
||||
@@ -365,22 +365,25 @@
|
||||
${render_workflow( key, val, False )}
|
||||
%elif key.startswith( 'section' ):
|
||||
<% section = val %>
|
||||
<div class="toolSectionTitle" id="title_${section.id}">
|
||||
<span>${section.name}</span>
|
||||
</div>
|
||||
<div id="${section.id}" class="toolSectionBody">
|
||||
<div class="toolSectionBg">
|
||||
%for section_key, section_val in section.elems.items():
|
||||
%if section_key.startswith( 'tool' ):
|
||||
${render_tool( section_val, True )}
|
||||
%elif section_key.startswith( 'workflow' ):
|
||||
${render_workflow( section_key, section_val, True )}
|
||||
%elif section_key.startswith( 'label' ):
|
||||
${render_label( section_val )}
|
||||
%endif
|
||||
%endfor
|
||||
## Render the section only if it is not empty.
|
||||
%if section.elems:
|
||||
<div class="toolSectionTitle" id="title_${section.id}">
|
||||
<span>${section.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="${section.id}" class="toolSectionBody">
|
||||
<div class="toolSectionBg">
|
||||
%for section_key, section_val in section.elems.items():
|
||||
%if section_key.startswith( 'tool' ):
|
||||
${render_tool( section_val, True )}
|
||||
%elif section_key.startswith( 'workflow' ):
|
||||
${render_workflow( section_key, section_val, True )}
|
||||
%elif section_key.startswith( 'label' ):
|
||||
${render_label( section_val )}
|
||||
%endif
|
||||
%endfor
|
||||
</div>
|
||||
</div>
|
||||
%endif
|
||||
%elif key.startswith( 'label' ):
|
||||
${render_label( val )}
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user