commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/12b6c2f80d0c/ Changeset: 12b6c2f80d0c User: dannon Date: 2013-06-19 21:22:38 Summary: Remove unused import from workflow controller Affected #: 1 file diff -r 170dd4c157b8b5e010804ba4a1ef3b5da08fa49d -r 12b6c2f80d0ccad385644a341971a8a27d7c4c78 lib/galaxy/webapps/galaxy/controllers/workflow.py --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -24,7 +24,6 @@ from galaxy.tools.parameters import RuntimeValue, visit_input_values from galaxy.tools.parameters.basic import DataToolParameter, DrillDownSelectToolParameter, SelectToolParameter, UnvalidatedValue from galaxy.tools.parameters.grouping import Conditional, Repeat -from galaxy.util.json import from_json_string from galaxy.util.odict import odict from galaxy.util.sanitize_html import sanitize_html from galaxy.util.topsort import CycleError, topsort, topsort_levels https://bitbucket.org/galaxy/galaxy-central/commits/31a4f8e9b732/ Changeset: 31a4f8e9b732 User: dannon Date: 2013-06-19 21:57:49 Summary: Enable loading of workflows post-installation of a tool (that the workflow contains) Affected #: 2 files diff -r 12b6c2f80d0ccad385644a341971a8a27d7c4c78 -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b lib/galaxy/webapps/galaxy/controllers/workflow.py --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -25,6 +25,7 @@ from galaxy.tools.parameters.basic import DataToolParameter, DrillDownSelectToolParameter, SelectToolParameter, UnvalidatedValue from galaxy.tools.parameters.grouping import Conditional, Repeat from galaxy.util.odict import odict +from galaxy.util.json import to_json_string from galaxy.util.sanitize_html import sanitize_html from galaxy.util.topsort import CycleError, topsort, topsort_levels from galaxy.web import error, url_for @@ -1770,12 +1771,15 @@ # FIXME: Position should be handled inside module step.position = step_dict['position'] module = module_factory.from_dict( trans, step_dict, secure=False ) + module.save_to_step( step ) if module.type == 'tool' and module.tool is None: # A required tool is not available in the local Galaxy instance. missing_tool_tup = ( step_dict[ 'tool_id' ], step_dict[ 'name' ], step_dict[ 'tool_version' ] ) if missing_tool_tup not in missing_tool_tups: missing_tool_tups.append( missing_tool_tup ) - module.save_to_step( step ) + # Save the entire step_dict in the unused config field, be parsed later + # when we do have the too when we do have the tool + step.config = to_json_string(step_dict) if step.tool_errors: workflow.has_errors = True # Stick this in the step temporarily diff -r 12b6c2f80d0ccad385644a341971a8a27d7c4c78 -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b lib/galaxy/workflow/modules.py --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -237,6 +237,10 @@ if tool: tool_id = tool.id if ( trans.app.toolbox and tool_id in trans.app.toolbox.tools_by_id ): + if step.config: + # This step has its state saved in the config field due to the + # tool being previously unavailable. + return module_factory.from_dict(trans, from_json_string(step.config), secure=False) module = Class( trans, tool_id ) module.state = galaxy.tools.DefaultToolState() module.state.inputs = module.tool.params_from_strings( step.tool_inputs, trans.app, ignore_errors=True ) https://bitbucket.org/galaxy/galaxy-central/commits/5df11b3f650d/ Changeset: 5df11b3f650d User: dannon Date: 2013-06-19 21:58:08 Summary: merge Affected #: 13 files diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -73,9 +73,8 @@ @web.expose @web.require_admin def browse_repository( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] ) return trans.fill_template( '/admin/tool_shed_repository/browse_repository.mako', repository=repository, @@ -154,9 +153,8 @@ @web.expose @web.require_admin def browse_tool_dependency( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) tool_dependency = tool_dependency_util.get_tool_dependency( trans, kwd[ 'id' ] ) if tool_dependency.in_error_state: message = "This tool dependency is not installed correctly (see the <b>Tool dependency installation error</b> below). " @@ -186,9 +184,8 @@ @web.expose @web.require_admin def browse_tool_sheds( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) return trans.fill_template( '/webapps/galaxy/admin/tool_sheds.mako', message=message, status='error' ) @@ -197,8 +194,7 @@ @web.require_admin def check_for_updates( self, trans, **kwd ): """Send a request to the relevant tool shed to see if there are any updates.""" - params = util.Params( kwd ) - repository_id = params.get( 'id', None ) + repository_id = kwd.get( 'id', None ) repository = suc.get_installed_tool_shed_repository( trans, repository_id ) tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed ) url = suc.url_join( tool_shed_url, @@ -215,10 +211,9 @@ is because it becomes a bit complex to determine if other installed repositories include tools that require the same entry. For now we'll never delete entries from config.shed_tool_data_table_config, but we may choose to do so in the future if it becomes necessary. """ - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) - remove_from_disk = params.get( 'remove_from_disk', '' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) + remove_from_disk = kwd.get( 'remove_from_disk', '' ) remove_from_disk_checked = CheckboxField.is_checked( remove_from_disk ) tool_shed_repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] ) shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository ) @@ -229,7 +224,7 @@ else: repository_install_dir = None errors = '' - if params.get( 'deactivate_or_uninstall_repository_button', False ): + if kwd.get( 'deactivate_or_uninstall_repository_button', False ): if tool_shed_repository.includes_tools_for_display_in_tool_panel: # Handle tool panel alterations. tool_util.remove_from_tool_panel( trans, tool_shed_repository, shed_tool_conf, uninstall=remove_from_disk_checked ) @@ -387,9 +382,8 @@ @web.require_admin def import_workflow( self, trans, workflow_name, repository_id, **kwd ): """Import a workflow contained in an installed tool shed repository into the Galaxy instance.""" - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) if workflow_name: workflow_name = encoding_util.tool_shed_decode( workflow_name ) repository = suc.get_tool_shed_repository_by_id( trans, repository_id ) @@ -486,12 +480,11 @@ @web.expose @web.require_admin def install_tool_dependencies( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) - tool_dependency_ids = util.listify( params.get( 'tool_dependency_ids', None ) ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) + tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) ) if not tool_dependency_ids: - tool_dependency_ids = util.listify( params.get( 'id', None ) ) + tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) tool_dependencies = [] for tool_dependency_id in tool_dependency_ids: tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) @@ -554,9 +547,8 @@ @web.expose @web.require_admin def manage_repository( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) repository_id = kwd[ 'id' ] operation = kwd.get( 'operation', None ) repository = suc.get_installed_tool_shed_repository( trans, repository_id ) @@ -574,7 +566,7 @@ 'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s' % \ ( repository.name, repository.owner, repository.installed_changeset_revision, ( web.url_for( '/', qualified=True ) ) ) ) return trans.response.send_redirect( url ) - description = util.restore_text( params.get( 'description', repository.description ) ) + description = kwd.get( 'description', repository.description ) shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository ) if relative_install_dir: repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, repository.name ) ) @@ -588,7 +580,7 @@ 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 ): + elif kwd.get( 'edit_repository_button', False ): if description != repository.description: repository.description = description trans.sa_session.add( repository ) @@ -611,13 +603,12 @@ @web.expose @web.require_admin def manage_repositories( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) - tsrid = params.get( 'tool_shed_repository_id', None ) - tsridslist = util.listify( params.get( 'tool_shed_repository_ids', None ) ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) + tsrid = kwd.get( 'tool_shed_repository_id', None ) + tsridslist = util.listify( kwd.get( 'tool_shed_repository_ids', None ) ) if not tsridslist: - tsridslist = util.listify( params.get( 'id', None ) ) + tsridslist = util.listify( kwd.get( 'id', None ) ) if tsrid and tsrid not in tsridslist: tsridslist.append( tsrid ) if 'operation' in kwd: @@ -650,7 +641,7 @@ kwd[ 'message' ] = 'All selected tool shed repositories are already uninstalled.' kwd[ 'status' ] = 'error' elif operation == "install": - reinstalling = util.string_as_bool( params.get( 'reinstalling', False ) ) + reinstalling = util.string_as_bool( kwd.get( 'reinstalling', False ) ) encoded_kwd = kwd[ 'encoded_kwd' ] decoded_kwd = encoding_util.tool_shed_decode( encoded_kwd ) tsr_ids = decoded_kwd[ 'tool_shed_repository_ids' ] @@ -686,9 +677,8 @@ @web.expose @web.require_admin def manage_tool_dependencies( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) # We need a tool_shed_repository, so get it from one of the tool_dependencies. tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) @@ -766,11 +756,10 @@ @web.expose @web.require_admin def monitor_repository_installation( self, trans, **kwd ): - params = util.Params( kwd ) - tsrid = params.get( 'tool_shed_repository_id', None ) - tsridslist = util.listify( params.get( 'tool_shed_repository_ids', None ) ) + tsrid = kwd.get( 'tool_shed_repository_id', None ) + tsridslist = util.listify( kwd.get( 'tool_shed_repository_ids', None ) ) if not tsridslist: - tsridslist = util.listify( params.get( 'id', None ) ) + tsridslist = util.listify( kwd.get( 'id', None ) ) if tsrid and tsrid not in tsridslist: tsridslist.append( tsrid ) if not tsridslist: @@ -1298,7 +1287,7 @@ if 'reset_metadata_on_selected_repositories_button' in kwd: message, status = metadata_util.reset_metadata_on_selected_repositories( trans, **kwd ) else: - message = util.restore_text( kwd.get( 'message', '' ) ) + message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) repositories_select_field = suc.build_repository_ids_select_field( trans ) return trans.fill_template( '/admin/tool_shed_repository/reset_metadata_on_selected_repositories.mako', @@ -1431,12 +1420,11 @@ @web.expose @web.require_admin def uninstall_tool_dependencies( self, trans, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) - tool_dependency_ids = util.listify( params.get( 'tool_dependency_ids', None ) ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) + tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) ) if not tool_dependency_ids: - tool_dependency_ids = util.listify( params.get( 'id', None ) ) + tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) tool_dependencies = [] for tool_dependency_id in tool_dependency_ids: tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) @@ -1476,15 +1464,14 @@ @web.require_admin def update_to_changeset_revision( self, trans, **kwd ): """Update a cloned repository to the latest revision possible.""" - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) tool_shed_url = kwd[ 'tool_shed_url' ] - name = params.get( 'name', None ) - owner = params.get( 'owner', None ) - changeset_revision = params.get( 'changeset_revision', None ) - latest_changeset_revision = params.get( 'latest_changeset_revision', None ) - latest_ctx_rev = params.get( 'latest_ctx_rev', None ) + name = kwd.get( 'name', None ) + owner = kwd.get( 'owner', None ) + changeset_revision = kwd.get( 'changeset_revision', None ) + latest_changeset_revision = kwd.get( 'latest_changeset_revision', None ) + latest_ctx_rev = kwd.get( 'latest_ctx_rev', None ) repository = suc.get_tool_shed_repository_by_shed_name_owner_changeset_revision( trans.app, tool_shed_url, name, owner, changeset_revision ) if changeset_revision and latest_changeset_revision and latest_ctx_rev: if changeset_revision == latest_changeset_revision: @@ -1568,9 +1555,8 @@ @web.expose @web.require_admin def view_tool_metadata( self, trans, repository_id, tool_id, **kwd ): - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) repository = suc.get_installed_tool_shed_repository( trans, repository_id ) repository_metadata = repository.metadata shed_config_dict = repository.get_shed_config_dict( trans.app ) @@ -1601,9 +1587,8 @@ @web.require_admin def view_workflow( self, trans, workflow_name=None, repository_id=None, **kwd ): """Retrieve necessary information about a workflow from the database so that it can be displayed in an svg image.""" - params = util.Params( kwd ) - message = util.restore_text( params.get( 'message', '' ) ) - status = params.get( 'status', 'done' ) + message = kwd.get( 'message', '' ) + status = kwd.get( 'status', 'done' ) if workflow_name: workflow_name = encoding_util.tool_shed_decode( workflow_name ) repository = suc.get_tool_shed_repository_by_id( trans, repository_id ) diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -74,9 +74,9 @@ def extract_tar( file_name, file_path ): if isgzip( file_name ) or isbz2( file_name ): # Open for reading with transparent compression. - tar = tarfile.open( file_name, 'r:*' ) + tar = tarfile.open( file_name, 'r:*', errorlevel=0 ) else: - tar = tarfile.open( file_name ) + tar = tarfile.open( file_name, errorlevel=0 ) tar.extractall( path=file_path ) tar.close() diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e lib/tool_shed/util/workflow_util.py --- a/lib/tool_shed/util/workflow_util.py +++ b/lib/tool_shed/util/workflow_util.py @@ -56,19 +56,19 @@ self.tool_id = tool_id self.tool = None self.errors = None - for tool_dict in tools_metadata: - if self.tool_id in [ tool_dict[ 'id' ], tool_dict[ 'guid' ] ]: - if trans.webapp.name == 'tool_shed': - # We're in the tool shed. + if trans.webapp.name == 'tool_shed': + # We're in the tool shed. + for tool_dict in tools_metadata: + if self.tool_id in [ tool_dict[ 'id' ], tool_dict[ 'guid' ] ]: repository, self.tool, message = tool_util.load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_dict[ 'tool_config' ] ) if message and self.tool is None: self.errors = 'unavailable' break - else: - # We're in Galaxy. - self.tool = trans.app.toolbox.tools_by_id.get( self.tool_id, None ) - if self.tool is None: - self.errors = 'unavailable' + else: + # We're in Galaxy. + self.tool = trans.app.toolbox.get_tool( self.tool_id ) + if self.tool is None: + self.errors = 'unavailable' self.post_job_actions = {} self.workflow_outputs = [] self.state = None diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -1,6 +1,7 @@ <%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /><%def name="stylesheets()"> ${parent.stylesheets()} @@ -13,22 +14,7 @@ ${browse_files(repository.name, repository.repo_files_directory(trans.app))} </%def> -<br/><br/> -<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"> - <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 - <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 ] %> - <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> - %endif - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -1,6 +1,7 @@ <%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /><%def name="stylesheets()"> ${parent.stylesheets()} @@ -15,23 +16,7 @@ <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %> -<br/><br/> -<ul class="manage-table-actions"> - <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> - <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 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> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -1,23 +1,9 @@ <%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /><%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> -<br/><br/> -<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"> - <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='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> - %endif - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e templates/admin/tool_shed_repository/initiate_repository_installation.mako --- a/templates/admin/tool_shed_repository/initiate_repository_installation.mako +++ b/templates/admin/tool_shed_repository/initiate_repository_installation.mako @@ -72,4 +72,3 @@ </div></div> %endif - diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -2,6 +2,7 @@ <%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /><%namespace file="/admin/tool_shed_repository/common.mako" import="*" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /><%def name="stylesheets()"> ${parent.stylesheets()} @@ -14,38 +15,7 @@ ${container_javascripts()} </%def> -<% - in_error_state = repository.in_error_state -%> - -<br/><br/> -<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 repository.can_reinstall_or_activate: - <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repositories', operation='activate or reinstall', id=trans.security.encode_id( repository.id ) )}">Activate or reinstall repository</a> - %endif - %if 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 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> - %elif repository.can_uninstall: - <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 - %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> - %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> - %endif - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e templates/admin/tool_shed_repository/repository_actions_menu.mako --- /dev/null +++ b/templates/admin/tool_shed_repository/repository_actions_menu.mako @@ -0,0 +1,40 @@ +<%inherit file="/base.mako"/> + +<%def name="render_galaxy_repository_actions( repository=None )"> + <% + from tool_shed.util.encoding_util import tool_shed_encode + in_error_state = repository.in_error_state + tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] + %> + <br/><br/> + <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 workflow_name: + <li><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='import_workflow', workflow_name=tool_shed_encode( workflow_name ), repository_id=trans.security.encode_id( repository.id ) )}">Import workflow to Galaxy</a></li> + %endif + %if repository.can_reinstall_or_activate: + <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repositories', operation='activate or reinstall', id=trans.security.encode_id( repository.id ) )}">Activate or reinstall repository</a> + %endif + %if in_error_state: + <a class="action-button" target="galaxy_main" 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 repository.can_install: + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ), operation='install' )}">Install</a> + %elif repository.can_uninstall: + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a> + <a class="action-button" target="galaxy_main" 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" target="galaxy_main" 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" target="galaxy_main" 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" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a> + %endif + %if tool_dependency_ids: + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> + %endif + <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a> + %endif + </div> + </ul> +</%def> \ No newline at end of file diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -1,22 +1,10 @@ <%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /><% import os %> -<br/><br/> -<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"> - <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.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> - %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> - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e 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 @@ -1,23 +1,8 @@ <%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> -<br/><br/> -<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"> - <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> - %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> - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e templates/admin/tool_shed_repository/view_workflow.mako --- a/templates/admin/tool_shed_repository/view_workflow.mako +++ b/templates/admin/tool_shed_repository/view_workflow.mako @@ -2,11 +2,9 @@ <%namespace file="/message.mako" import="render_msg" /><%namespace file="/webapps/tool_shed/common/common.mako" import="*" /><%namespace file="/webapps/tool_shed/repository/common.mako" import="*" /> +<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" /> -<% - from galaxy.web.framework.helpers import time_ago - from tool_shed.util.encoding_util import tool_shed_encode -%> +<% from tool_shed.util.encoding_util import tool_shed_encode %><%! def inherit(context): @@ -22,24 +20,7 @@ <iframe name="workflow_image" id="workflow_image" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe></%def> -<br/><br/> -<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"> - <li><a class="action-button" target='galaxy_main' href="${h.url_for( controller='admin_toolshed', action='import_workflow', workflow_name=tool_shed_encode( workflow_name ), repository_id=repository_id )}">Import workflow to Galaxy</a></li> - <a class="action-button" target='galaxy_main' 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" target='galaxy_main' href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a> - <a class="action-button" target='galaxy_main' 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" target='galaxy_main' 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" target='galaxy_main' href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a> - %endif - <a class="action-button" target='galaxy_main' href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a> - </div> -</ul> +${render_galaxy_repository_actions( repository )} %if message: ${render_msg( message, status )} diff -r 31a4f8e9b7324b870b44dcbd2d3c4c7f958fed6b -r 5df11b3f650d4dbaa9e8a37e6501271bc06a489e test/tool_shed/functional/test_0000_basic_repository_features.py --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -353,5 +353,5 @@ # Check for the changeset revision, repository name, owner username, 'repos' in the clone url, and the captured # unicode decoding error message. strings_displayed = [ 'Changeset %d:%s' % ( revision_number, revision_hash ), 'filtering_0000', 'user1', 'repos', 'added:', - 'Error decoding string:', "codec can't decode byte" ] + '+These characters should not' ] self.load_changeset_in_tool_shed( repository_id, changeset_revision, strings_displayed=strings_displayed ) \ No newline at end of file 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)
-
commits-noreply@bitbucket.org