(1) enhance the 'Manage installed tool shed repositories' grid to mark repositories that contain exported workflows, (2) Set the tool_shed_status column value when installing a new repository or reinstalling an uninstalled repository, (3) On the 'Manage installed tool shed repositories' gird, display installed repositories ordered by tool_shed, name, owner, ctx_rev.

This commit is contained in:
Greg Von Kuster
2013-10-01 14:31:40 -04:00
parent 2e20f84d26
commit ff38532b76
2 changed files with 19 additions and 1 deletions
@@ -15,6 +15,13 @@ def generate_deprecated_repository_img_str( include_mouse_over=False ):
deprecated_tip_str = ''
return '<img src="/static/images/icon_error_sml.gif" %s/>' % deprecated_tip_str
def generate_includes_workflows_img_str( include_mouse_over=False ):
if include_mouse_over:
deprecated_tip_str = 'class="icon-button" title="This repository contains exported workflows"'
else:
deprecated_tip_str = ''
return '<img src="/static/images/fugue/gear.png" %s/>' % deprecated_tip_str
def generate_latest_revision_img_str( include_mouse_over=False ):
if include_mouse_over:
latest_revision_tip_str = 'class="icon-button" title="This is the latest installable revision of this repository"'
@@ -60,6 +67,8 @@ class InstalledRepositoryGrid( grids.Grid ):
tool_shed_status_str += generate_revision_updates_img_str( include_mouse_over=True )
if tool_shed_repository.upgrade_available:
tool_shed_status_str += generate_revision_upgrades_img_str( include_mouse_over=True )
if tool_shed_repository.includes_workflows:
tool_shed_status_str += generate_includes_workflows_img_str( include_mouse_over=True )
else:
tool_shed_status_str = generate_unknown_img_str( include_mouse_over=True )
return tool_shed_status_str
@@ -211,7 +220,11 @@ class InstalledRepositoryGrid( grids.Grid ):
use_paging = False
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( self.model_class )
return trans.sa_session.query( self.model_class ) \
.order_by( self.model_class.table.c.tool_shed,
self.model_class.table.c.name,
self.model_class.table.c.owner,
self.model_class.table.c.ctx_rev )
@property
def legend( self ):
@@ -219,6 +232,7 @@ class InstalledRepositoryGrid( grids.Grid ):
legend_str += '%s&nbsp;&nbsp;A newer installable revision is available for this repository<br/>' % generate_revision_upgrades_img_str()
legend_str += '%s&nbsp;&nbsp;This is the latest installable revision of this repository<br/>' % generate_latest_revision_img_str()
legend_str += '%s&nbsp;&nbsp;This repository is deprecated in the Tool Shed<br/>' % generate_deprecated_repository_img_str()
legend_str += '%s&nbsp;&nbsp;This repository contains exported workflows<br/>' % generate_includes_workflows_img_str()
legend_str += '%s&nbsp;&nbsp;Unable to get information from the Tool Shed<br/>' % generate_unknown_img_str()
return legend_str
@@ -352,6 +352,10 @@ def handle_repository_contents( trans, tool_shed_repository, tool_path, reposito
updating_installed_repository=False,
persist=True )
tool_shed_repository.metadata = metadata_dict
# Update the tool_shed_repository.tool_shed_status column in the database.
tool_shed_status_dict = suc.get_tool_shed_status_for_installed_repository( trans.app, tool_shed_repository )
if tool_shed_status_dict:
tool_shed_repository.tool_shed_status = tool_shed_status_dict
trans.sa_session.add( tool_shed_repository )
trans.sa_session.flush()
if 'tool_dependencies' in metadata_dict and not reinstalling: