commit/galaxy-central: greg: Allow the Galaxy admin to reset metadata on installed tool shed repositories.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/eb0e59dcbfbb/ changeset: eb0e59dcbfbb user: greg date: 2012-09-28 19:27:19 summary: Allow the Galaxy admin to reset metadata on installed tool shed repositories. affected #: 9 files diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -2971,7 +2971,7 @@ def repo_files_directory( self, app ): repo_path = self.repo_path( app ) if repo_path: - return os.path.join( app.config.root, repo_path, self.name ) + return os.path.join( repo_path, self.name ) return None def repo_path( self, app ): tool_shed_url = self.tool_shed @@ -2981,11 +2981,17 @@ tool_shed = tool_shed_url.rstrip( '/' ) for index, shed_tool_conf_dict in enumerate( app.toolbox.shed_tool_confs ): tool_path = shed_tool_conf_dict[ 'tool_path' ] - relative_path = os.path.join( app.config.root, tool_path, tool_shed, 'repos', self.owner, self.name, self.installed_changeset_revision ) + relative_path = os.path.join( tool_path, tool_shed, 'repos', self.owner, self.name, self.installed_changeset_revision ) if os.path.exists( relative_path ): return relative_path return None @property + def can_install( self ): + return self.status == self.installation_status.NEW + @property + def can_reset_metadata( self ): + return self.status == self.installation_status.INSTALLED + @property def includes_tools( self ): return self.metadata and 'tools' in self.metadata @property @@ -2995,6 +3001,12 @@ def includes_workflows( self ): return self.metadata and 'workflows' in self.metadata @property + def in_error_state( self ): + return self.status == self.installation_status.ERROR + @property + def has_readme( self ): + return self.metadata and 'readme' in self.metadata + @property def installed_tool_dependencies( self ): """Return the repository's tool dependencies that are currently installed.""" installed_dependencies = [] @@ -3061,6 +3073,15 @@ self.type = type self.status = status self.error_message = error_message + @property + def can_install( self ): + return self.status in [ self.installation_status.NEVER_INSTALLED, self.installation_status.UNINSTALLED ] + @property + def can_uninstall( self ): + return self.status in [ self.installation_status.ERROR, self.installation_status.INSTALLED ] + @property + def in_error_state( self ): + return self.status == self.installation_status.ERROR def installation_directory( self, app ): if self.type == 'package': return os.path.join( app.config.tool_dependency_dir, diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -1561,16 +1561,13 @@ for elem in root: if elem.tag == 'package': # Only install the tool_dependency if it is not already installed. - can_install = False package_name = elem.get( 'name', None ) package_version = elem.get( 'version', None ) if package_name and package_version: for tool_dependency in tool_dependencies: if tool_dependency.name==package_name and tool_dependency.version==package_version: - can_install = tool_dependency.status in [ app.model.ToolDependency.installation_status.NEVER_INSTALLED, - app.model.ToolDependency.installation_status.UNINSTALLED ] break - if can_install: + if tool_dependency.can_install: tool_dependency = install_package( app, elem, tool_shed_repository, tool_dependencies=tool_dependencies ) if tool_dependency and tool_dependency.status in [ app.model.ToolDependency.installation_status.INSTALLED, app.model.ToolDependency.installation_status.ERROR ]: diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 lib/galaxy/web/controllers/admin_toolshed.py --- a/lib/galaxy/web/controllers/admin_toolshed.py +++ b/lib/galaxy/web/controllers/admin_toolshed.py @@ -342,10 +342,8 @@ message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) repository = get_repository( trans, kwd[ 'id' ] ) - has_readme = repository.metadata and 'readme' in repository.metadata return trans.fill_template( '/admin/tool_shed_repository/browse_repository.mako', repository=repository, - has_readme=has_readme, message=message, status=status ) @web.expose @@ -354,24 +352,38 @@ if 'operation' in kwd: operation = kwd.pop( 'operation' ).lower() if operation == "manage_repository": - return self.manage_repository( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='manage_repository', + **kwd ) ) if operation == "get updates": - return self.check_for_updates( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='check_for_updates', + **kwd ) ) if operation == "reset to install": kwd[ 'reset_repository' ] = True - return self.reset_to_install( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='reset_to_install', + **kwd ) ) if operation == "activate or reinstall": repository = get_repository( trans, kwd[ 'id' ] ) if repository.uninstalled: if repository.includes_tools: # Only allow selecting a different section in the tool panel if the repository was uninstalled. - return self.reselect_tool_panel_section( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='reselect_tool_panel_section', + **kwd ) ) else: - return self.reinstall_repository( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='reinstall_repository', + **kwd ) ) else: - return self.activate_repository( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='activate_repository', + **kwd ) ) if operation == "deactivate or uninstall": - return self.deactivate_or_uninstall_repository( trans, **kwd ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='deactivate_or_uninstall_repository', + **kwd ) ) if 'message' not in kwd or not kwd[ 'message' ]: kwd[ 'message' ] = 'Names of repositories for which updates are available are highlighted in yellow.' return self.installed_repository_grid( trans, **kwd ) @@ -382,22 +394,15 @@ message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) tool_dependency = get_tool_dependency( trans, kwd[ 'id' ] ) - in_error_state = tool_dependency.status == trans.model.ToolDependency.installation_status.ERROR - can_uninstall = tool_dependency.status in [ trans.model.ToolDependency.installation_status.ERROR, - trans.model.ToolDependency.installation_status.INSTALLED ] - if in_error_state: + if tool_dependency.in_error_state: message = "This tool dependency is not installed correctly (see the <b>Tool dependency installation error</b> below). " message += "Choose <b>Uninstall this tool dependency</b> from the <b>Repository Actions</b> menu, correct problems " message += "if necessary, and try installing the dependency again." status = "error" tool_shed_repository = tool_dependency.tool_shed_repository - has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata return trans.fill_template( '/admin/tool_shed_repository/browse_tool_dependency.mako', repository=tool_shed_repository, - has_readme=has_readme, tool_dependency=tool_dependency, - in_error_state=in_error_state, - can_uninstall=can_uninstall, message=message, status=status ) @web.expose @@ -492,11 +497,9 @@ message=message, status=status ) ) remove_from_disk_check_box = CheckboxField( 'remove_from_disk', checked=remove_from_disk_checked ) - has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata return trans.fill_template( '/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako', repository=tool_shed_repository, remove_from_disk_check_box=remove_from_disk_check_box, - has_readme=has_readme, message=message, status=status ) @web.expose @@ -794,13 +797,11 @@ repository_id = kwd[ 'id' ] operation = kwd.get( 'operation', None ) repository = get_repository( trans, repository_id ) - in_error_state = repository.status == trans.model.ToolShedRepository.installation_status.ERROR - can_install = repository.status == trans.model.ToolShedRepository.installation_status.NEW if repository.status in [ trans.model.ToolShedRepository.installation_status.CLONING ]: return trans.response.send_redirect( web.url_for( controller='admin_toolshed', action='monitor_repository_installation', **kwd ) ) - if can_install and operation == 'install': + if repository.can_install and operation == 'install': # Send a request to the tool shed to install the repository. tool_shed_url = get_url_from_repository_tool_shed( trans.app, repository ) url = url_join( tool_shed_url, @@ -816,12 +817,12 @@ repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) ) else: repo_files_dir = None - if in_error_state: + if repository.in_error_state: message = "This repository is not installed correctly (see the <b>Repository installation error</b> below). Choose " message += "<b>Reset to install</b> from the <b>Repository Actions</b> menu, correct problems if necessary, and try " message += "installing the repository again." status = "error" - elif can_install: + elif repository.can_install: message = "This repository is not installed. You can install it by choosing <b>Install</b> from the <b>Repository Actions</b> menu." status = "error" elif params.get( 'edit_repository_button', False ): @@ -830,27 +831,8 @@ trans.sa_session.add( repository ) trans.sa_session.flush() message = "The repository information has been updated." - elif params.get( 'set_metadata_button', False ): - repository_clone_url = generate_clone_url( trans, repository ) - # TODO: Fix this by setting up a temporary work_dir - there is currently no way for an admin to reset metadata on an - # installed tool shed repository because the manage_repository template checs the value of can_reset_metadata, whic is - # currently always False. - metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app, - repository_clone_url=repository_clone_url, - relative_install_dir=None, - repository_files_dir=repository_files_dir, - resetting_all_metadata_on_repository=True ) - if metadata_dict: - repository.metadata = metadata_dict - trans.sa_session.add( repository ) - trans.sa_session.flush() - message = "Repository metadata has been reset." - has_readme = repository.metadata and 'readme' in repository.metadata return trans.fill_template( '/admin/tool_shed_repository/manage_repository.mako', repository=repository, - has_readme=has_readme, - in_error_state=in_error_state, - can_install=can_install, description=description, repo_files_dir=repo_files_dir, message=message, @@ -1452,8 +1434,38 @@ status=status ) @web.expose @web.require_admin + def reset_repository_metadata( self, trans, id ): + """Reset all metadata on the installed tool shed repository.""" + repository = get_repository( trans, id ) + tool_shed_url = get_url_from_repository_tool_shed( trans.app, repository ) + repository_clone_url = self.__generate_clone_url( trans, repository ) + relative_install_dir = repository.repo_path( trans.app ) + if relative_install_dir: + metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app, + repository=repository, + repository_clone_url=repository_clone_url, + relative_install_dir=relative_install_dir, + repository_files_dir=None, + resetting_all_metadata_on_repository=False, + webapp='galaxy' ) + repository.metadata = metadata_dict + trans.sa_session.add( repository ) + trans.sa_session.flush() + message = 'Metadata has been reset on repository <b>%s</b>.' % repository.name + status = 'done' + else: + message = 'Error locating installation directory for repository <b>%s</b>.' % repository.name + status = 'error' + new_kwd = dict( id=id, + message=message, + status=status ) + return trans.response.send_redirect( web.url_for( controller='admin_toolshed', + action='manage_repository', + **new_kwd ) ) + @web.expose + @web.require_admin def reset_to_install( self, trans, **kwd ): - # An error occurred while cloning the repository, so reset everything necessary to enable another attempt. + """An error occurred while cloning the repository, so reset everything necessary to enable another attempt.""" repository = get_repository( trans, kwd[ 'id' ] ) if kwd.get( 'reset_repository', False ): self.set_repository_attributes( trans, @@ -1549,7 +1561,6 @@ tool_dependency = get_tool_dependency( trans, tool_dependency_id ) tool_dependencies.append( tool_dependency ) tool_shed_repository = tool_dependencies[ 0 ].tool_shed_repository - has_readme = tool_shed_repository.metadata and 'readme' in tool_shed_repository.metadata if kwd.get( 'uninstall_tool_dependencies_button', False ): errors = False # Filter tool dependencies to only those that are installed. @@ -1576,7 +1587,6 @@ message=message ) ) return trans.fill_template( '/admin/tool_shed_repository/uninstall_tool_dependencies.mako', repository=tool_shed_repository, - has_readme=has_readme, tool_dependency_ids=tool_dependency_ids, tool_dependencies=tool_dependencies, message=message, @@ -1609,6 +1619,7 @@ # Update the repository metadata. tool_shed = clean_tool_shed_url( tool_shed_url ) metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app, + repository=repository, repository_clone_url=repository_clone_url, relative_install_dir=relative_install_dir, repository_files_dir=None, @@ -1681,7 +1692,7 @@ for tool_metadata_dict in repository_metadata[ 'tools' ]: if tool_metadata_dict[ 'id' ] == tool_id: tool_metadata = tool_metadata_dict - tool = trans.app.toolbox.load_tool( os.path.abspath( tool_metadata[ 'tool_config' ] ), guid=metadata[ 'guid' ] ) + tool = trans.app.toolbox.load_tool( os.path.abspath( tool_metadata[ 'tool_config' ] ), guid=tool_metadata[ 'guid' ] ) if tool: tool_lineage = self.get_versions_of_tool( trans.app, tool.id ) break diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/browse_repository.mako --- a/templates/admin/tool_shed_repository/browse_repository.mako +++ b/templates/admin/tool_shed_repository/browse_repository.mako @@ -18,10 +18,13 @@ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a> - %if has_readme: + %if repository.has_readme: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a> %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> + %if repository.can_reset_metadata: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> + %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a> %if repository.tool_dependencies: <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %> diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/browse_tool_dependency.mako --- a/templates/admin/tool_shed_repository/browse_tool_dependency.mako +++ b/templates/admin/tool_shed_repository/browse_tool_dependency.mako @@ -20,14 +20,17 @@ <li><a class="action-button" id="tool_dependency-${tool_dependency.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="tool_dependency-${tool_dependency.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a> - %if has_readme: + %if repository.has_readme: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a> %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> + %if repository.can_reset_metadata: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> + %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> - %if can_uninstall: + %if tool_dependency.can_uninstall: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='uninstall_tool_dependencies', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ) )}">Uninstall this tool dependency</a> %endif </div> @@ -55,7 +58,7 @@ ${tool_dependency.status} <div style="clear: both"></div></div> - %if in_error_state: + %if repository.in_error_state: <div class="form-row" ><label>Tool dependency installation error:</label> ${tool_dependency.error_message} diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako --- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako +++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako @@ -7,11 +7,14 @@ <li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a> - %if has_readme: + %if repository.has_readme: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a> %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> + %if repository.can_reset_metadata: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> + %endif %if repository.tool_dependencies: <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/manage_repository.mako --- a/templates/admin/tool_shed_repository/manage_repository.mako +++ b/templates/admin/tool_shed_repository/manage_repository.mako @@ -6,16 +6,19 @@ <ul class="manage-table-actions"><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> - %if in_error_state: + %if repository.in_error_state: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_to_install', id=trans.security.encode_id( repository.id ), reset_repository=True )}">Reset to install</a> - %elif can_install: + %elif repository.can_install: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ), operation='install' )}">Install</a> %else: - %if has_readme: + %if repository.has_readme: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a> %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> + %if repository.can_reset_metadata: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> + %endif %if repository.includes_tools: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a> %endif @@ -87,229 +90,219 @@ </div></div><p/> -<div class="toolForm"> - <div class="toolFormTitle">${repository.name}</div> - <div class="toolFormBody"> - <% - metadata = repository.metadata - missing_tool_dependencies = repository.missing_tool_dependencies - installed_tool_dependencies = repository.installed_tool_dependencies - %> - %if missing_tool_dependencies: - <div class="form-row"> - <table width="100%"> - <tr bgcolor="#D8D8D8" width="100%"> - <td><b>Missing tool dependencies</i></td> - </tr> - </table> - </div> - <div style="clear: both"></div> - <div class="form-row"> - <table class="grid"> - <tr> - <td><b>name</b></td> - <td><b>version</b></td> - <td><b>type</b></td> - <td><b>status</b></td> - </tr> - %for tool_dependency in missing_tool_dependencies: +%if not in_error_state: + <div class="toolForm"> + <div class="toolFormTitle">${repository.name}</div> + <div class="toolFormBody"> + <% + metadata = repository.metadata + missing_tool_dependencies = repository.missing_tool_dependencies + installed_tool_dependencies = repository.installed_tool_dependencies + %> + %if missing_tool_dependencies: + <div class="form-row"> + <table width="100%"> + <tr bgcolor="#D8D8D8" width="100%"> + <td><b>Missing tool dependencies</i></td> + </tr> + </table> + </div> + <div style="clear: both"></div> + <div class="form-row"> + <table class="grid"><tr> - <td> - <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', id=trans.security.encode_id( tool_dependency.id ) )}"> - ${tool_dependency.name} - </a> - </td> - <td>${tool_dependency.version}</td> - <td>${tool_dependency.type}</td> - <td>${tool_dependency.status}</td> + <td><b>name</b></td> + <td><b>version</b></td> + <td><b>type</b></td> + <td><b>status</b></td></tr> - %endfor - </table> - </div> - <div style="clear: both"></div> - %endif - %if installed_tool_dependencies: - <div class="form-row"> - <table width="100%"> - <tr bgcolor="#D8D8D8" width="100%"> - <td><b>Installed tool dependencies<i> - click the name to browse the dependency installation directory</i></td> - </tr> - </table> - </div> - <div style="clear: both"></div> - <div class="form-row"> - <table class="grid"> - <tr> - <td><b>name</b></td> - <td><b>version</b></td> - <td><b>type</b></td> - </tr> - %for installed_tool_dependency in installed_tool_dependencies: + %for tool_dependency in missing_tool_dependencies: + <tr> + <td> + <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', id=trans.security.encode_id( tool_dependency.id ) )}"> + ${tool_dependency.name} + </a> + </td> + <td>${tool_dependency.version}</td> + <td>${tool_dependency.type}</td> + <td>${tool_dependency.status}</td> + </tr> + %endfor + </table> + </div> + <div style="clear: both"></div> + %endif + %if installed_tool_dependencies: + <div class="form-row"> + <table width="100%"> + <tr bgcolor="#D8D8D8" width="100%"> + <td><b>Installed tool dependencies<i> - click the name to browse the dependency installation directory</i></td> + </tr> + </table> + </div> + <div style="clear: both"></div> + <div class="form-row"> + <table class="grid"><tr> - <td> - <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( installed_tool_dependency.id ), repository_id=trans.security.encode_id( repository.id ) )}"> - ${installed_tool_dependency.name} - </a> - </td> - <td>${installed_tool_dependency.version}</td> - <td>${installed_tool_dependency.type}</td> + <td><b>name</b></td> + <td><b>version</b></td> + <td><b>type</b></td></tr> - %endfor - </table> - </div> - <div style="clear: both"></div> - %endif - %if 'tools' in metadata: - <div class="form-row"> - <table width="100%"> - <tr bgcolor="#D8D8D8" width="100%"> - <td><b>Tools</b><i> - click the name to view information about the tool</i></td> - </tr> - </table> - </div> - <div class="form-row"> - <% tool_dicts = metadata[ 'tools' ] %> - <table class="grid"> - <tr> - <td><b>name</b></td> - <td><b>description</b></td> - <td><b>version</b></td> - <td><b>requirements</b></td> - </tr> - %for tool_dict in tool_dicts: + %for installed_tool_dependency in installed_tool_dependencies: + <tr> + <td> + <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( installed_tool_dependency.id ), repository_id=trans.security.encode_id( repository.id ) )}"> + ${installed_tool_dependency.name} + </a> + </td> + <td>${installed_tool_dependency.version}</td> + <td>${installed_tool_dependency.type}</td> + </tr> + %endfor + </table> + </div> + <div style="clear: both"></div> + %endif + %if 'tools' in metadata: + <div class="form-row"> + <table width="100%"> + <tr bgcolor="#D8D8D8" width="100%"> + <td><b>Tools</b><i> - click the name to view information about the tool</i></td> + </tr> + </table> + </div> + <div class="form-row"> + <% tool_dicts = metadata[ 'tools' ] %> + <table class="grid"><tr> - <td> - <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), tool_id=tool_dict[ 'id' ] )}"> - ${tool_dict[ 'name' ]} - </a> - </td> - <td>${tool_dict[ 'description' ]}</td> - <td>${tool_dict[ 'version' ]}</td> - <td> - <% - if 'requirements' in tool_dict: - requirements = tool_dict[ 'requirements' ] - else: - requirements = None - %> - %if requirements: + <td><b>name</b></td> + <td><b>description</b></td> + <td><b>version</b></td> + <td><b>requirements</b></td> + </tr> + %for tool_dict in tool_dicts: + <tr> + <td> + <a class="view-info" href="${h.url_for( controller='admin_toolshed', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), tool_id=tool_dict[ 'id' ] )}"> + ${tool_dict[ 'name' ]} + </a> + </td> + <td>${tool_dict[ 'description' ]}</td> + <td>${tool_dict[ 'version' ]}</td> + <td><% - requirements_str = '' - for requirement_dict in tool_dict[ 'requirements' ]: - requirements_str += '%s (%s), ' % ( requirement_dict[ 'name' ], requirement_dict[ 'type' ] ) - requirements_str = requirements_str.rstrip( ', ' ) + if 'requirements' in tool_dict: + requirements = tool_dict[ 'requirements' ] + else: + requirements = None %> - ${requirements_str} - %else: - none - %endif - </td> + %if requirements: + <% + requirements_str = '' + for requirement_dict in tool_dict[ 'requirements' ]: + requirements_str += '%s (%s), ' % ( requirement_dict[ 'name' ], requirement_dict[ 'type' ] ) + requirements_str = requirements_str.rstrip( ', ' ) + %> + ${requirements_str} + %else: + none + %endif + </td> + </tr> + %endfor + </table> + </div> + <div style="clear: both"></div> + %endif + %if 'workflows' in metadata: + ## metadata[ 'workflows' ] is a list of tuples where each contained tuple is + ## [ <relative path to the .ga file in the repository>, <exported workflow dict> ] + <div class="form-row"> + <table width="100%"> + <tr bgcolor="#D8D8D8" width="100%"> + <td><b>Workflows</b><i> - click the name to import</i></td></tr> - %endfor - </table> - </div> - <div style="clear: both"></div> - %endif - %if 'workflows' in metadata: - ## metadata[ 'workflows' ] is a list of tuples where each contained tuple is - ## [ <relative path to the .ga file in the repository>, <exported workflow dict> ] - <div class="form-row"> - <table width="100%"> - <tr bgcolor="#D8D8D8" width="100%"> - <td><b>Workflows</b><i> - click the name to import</i></td> - </tr> - </table> - </div> - <div style="clear: both"></div> - <div class="form-row"> - <% workflow_tups = metadata[ 'workflows' ] %> - <table class="grid"> - <tr> - <td><b>name</b></td> - <td><b>steps</b></td> - <td><b>format-version</b></td> - <td><b>annotation</b></td> - </tr> - <% index = 0 %> - %for workflow_tup in workflow_tups: - <% - import os.path - relative_path = workflow_tup[ 0 ] - full_path = os.path.abspath( relative_path ) - workflow_dict = workflow_tup[ 1 ] - workflow_name = workflow_dict[ 'name' ] - ## Initially steps were not stored in the metadata record. - steps = workflow_dict.get( 'steps', [] ) - format_version = workflow_dict[ 'format-version' ] - annotation = workflow_dict[ 'annotation' ] - %> + </table> + </div> + <div style="clear: both"></div> + <div class="form-row"> + <% workflow_tups = metadata[ 'workflows' ] %> + <table class="grid"><tr> - <td> - <div class="menubutton" style="float: left;" id="workflow-${index}-popup"> - ${workflow_name} - <div popupmenu="workflow-${index}-popup"> - <a class="action-button" href="${h.url_for( controller='workflow', action='import_workflow', installed_repository_file=full_path, repository_id=trans.security.encode_id( repository.id ) )}">Import to Galaxy</a> + <td><b>name</b></td> + <td><b>steps</b></td> + <td><b>format-version</b></td> + <td><b>annotation</b></td> + </tr> + <% index = 0 %> + %for workflow_tup in workflow_tups: + <% + import os.path + relative_path = workflow_tup[ 0 ] + full_path = os.path.abspath( relative_path ) + workflow_dict = workflow_tup[ 1 ] + workflow_name = workflow_dict[ 'name' ] + ## Initially steps were not stored in the metadata record. + steps = workflow_dict.get( 'steps', [] ) + format_version = workflow_dict[ 'format-version' ] + annotation = workflow_dict[ 'annotation' ] + %> + <tr> + <td> + <div class="menubutton" style="float: left;" id="workflow-${index}-popup"> + ${workflow_name} + <div popupmenu="workflow-${index}-popup"> + <a class="action-button" href="${h.url_for( controller='workflow', action='import_workflow', installed_repository_file=full_path, repository_id=trans.security.encode_id( repository.id ) )}">Import to Galaxy</a> + </div></div> - </div> - </td> - <td> - %if steps: - ${len( steps )} - %else: - unknown - %endif - </td> - <td>${format_version}</td> - <td>${annotation}</td> + </td> + <td> + %if steps: + ${len( steps )} + %else: + unknown + %endif + </td> + <td>${format_version}</td> + <td>${annotation}</td> + </tr> + <% index += 1 %> + %endfor + </table> + </div> + <div style="clear: both"></div> + %endif + %if 'datatypes' in metadata: + <div class="form-row"> + <table width="100%"> + <tr bgcolor="#D8D8D8" width="100%"> + <td><b>Data types</b></td></tr> - <% index += 1 %> - %endfor - </table> - </div> - <div style="clear: both"></div> - %endif - %if 'datatypes' in metadata: - <div class="form-row"> - <table width="100%"> - <tr bgcolor="#D8D8D8" width="100%"> - <td><b>Data types</b></td> - </tr> - </table> - </div> - <div style="clear: both"></div> - <div class="form-row"> - <% datatypes_dicts = metadata[ 'datatypes' ] %> - <table class="grid"> - <tr> - <td><b>extension</b></td> - <td><b>type</b></td> - <td><b>mimetype</b></td> - <td><b>subclass</b></td> - </tr> - %for datatypes_dict in datatypes_dicts: + </table> + </div> + <div style="clear: both"></div> + <div class="form-row"> + <% datatypes_dicts = metadata[ 'datatypes' ] %> + <table class="grid"><tr> - <td>${datatypes_dict.get( 'extension', ' ' )}</td> - <td>${datatypes_dict.get( 'dtype', ' ' )}</td> - <td>${datatypes_dict.get( 'mimetype', ' ' )}</td> - <td>${datatypes_dict.get( 'subclass', ' ' )}</td> + <td><b>extension</b></td> + <td><b>type</b></td> + <td><b>mimetype</b></td> + <td><b>subclass</b></td></tr> - %endfor - </table> - </div> - <div style="clear: both"></div> - %endif - %if can_reset_metadata: - <form name="set_metadata" action="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}" method="post"> - <div class="form-row"> - <div style="float: left; width: 250px; margin-right: 10px;"> - <input type="submit" name="set_metadata_button" value="Reset metadata"/> - </div> - <div class="toolParamHelp" style="clear: both;"> - Inspect the repository and reset the above attributes. - </div> + %for datatypes_dict in datatypes_dicts: + <tr> + <td>${datatypes_dict.get( 'extension', ' ' )}</td> + <td>${datatypes_dict.get( 'dtype', ' ' )}</td> + <td>${datatypes_dict.get( 'mimetype', ' ' )}</td> + <td>${datatypes_dict.get( 'subclass', ' ' )}</td> + </tr> + %endfor + </table></div> - </form> - %endif + <div style="clear: both"></div> + %endif + </div></div> -</div> -<p/> + <p/> +%endif diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako --- a/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako +++ b/templates/admin/tool_shed_repository/uninstall_tool_dependencies.mako @@ -7,7 +7,7 @@ <ul class="manage-table-actions"><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"> - %if has_readme: + %if repository.has_readme: <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_readme', id=trans.security.encode_id( repository.id ) )}">View README</a> %endif <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a> diff -r 1332bbac03097060066b9825ab3f85a5223f8655 -r eb0e59dcbfbb98783ef8341f0084e2c03a36ca38 templates/admin/tool_shed_repository/view_tool_metadata.mako --- a/templates/admin/tool_shed_repository/view_tool_metadata.mako +++ b/templates/admin/tool_shed_repository/view_tool_metadata.mako @@ -11,6 +11,9 @@ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a> + %if repository.can_reset_metadata: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a> + %endif %if repository.tool_dependencies: <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> 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