commit/galaxy-central: 4 new changesets

4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/1177b255f17d/ Changeset: 1177b255f17d User: martenson Date: 2015-02-23 22:42:17+00:00 Summary: add API endpoint to create TS repository Affected #: 3 files diff -r a12fc23ff13785d2c2ef7d223dca100ef334ea87 -r 1177b255f17d80190849fc64a5ce9bd88bbe7fd7 lib/galaxy/webapps/tool_shed/api/repositories.py --- a/lib/galaxy/webapps/tool_shed/api/repositories.py +++ b/lib/galaxy/webapps/tool_shed/api/repositories.py @@ -10,8 +10,10 @@ from galaxy import util from galaxy import web +from galaxy import exceptions from galaxy.datatypes import checkers from galaxy.model.orm import and_ +from galaxy.web import _future_expose_api as expose_api from galaxy.web.base.controller import BaseAPIController from galaxy.web.base.controller import HTTPBadRequest from galaxy.web.framework.helpers import time_ago @@ -31,6 +33,7 @@ from tool_shed.util import shed_util_common as suc from tool_shed.util import tool_util + log = logging.getLogger( __name__ ) @@ -577,13 +580,72 @@ id=trans.security.encode_id( repository.id ) ) return repository_dict + @expose_api + def create( self, trans, payload, **kwd ): + """ + create( self, trans, payload, **kwd ) + * POST /api/repositories: + Creates a new repository. + Only ``name`` and ``synopsis`` parameters are required. + + :param payload: dictionary structure containing:: + 'name': new repo's name (required) + 'synopsis': new repo's synopsis (required) + 'description': new repo's description (optional) + 'remote_repository_url': new repo's remote repo (optional) + 'homepage_url': new repo's homepage url (optional) + 'category_ids[]': list of existing encoded TS category ids + the new repo should be associated with (optional) + 'type': new repo's type, defaults to ``unrestricted`` (optional) + + :type payload: dict + + :returns: detailed repository information + :rtype: dict + + :raises: RequestParameterMissingException + """ + params = util.Params( payload ) + name = util.restore_text( params.get( 'name', None ) ) + if not name: + raise exceptions.RequestParameterMissingException( "Missing required parameter 'name'." ) + synopsis = util.restore_text( params.get( 'synopsis', None ) ) + if not synopsis: + raise exceptions.RequestParameterMissingException( "Missing required parameter 'synopsis'." ) + + description = util.restore_text( params.get( 'description', '' ) ) + remote_repository_url = util.restore_text( params.get( 'remote_repository_url', '' ) ) + homepage_url = util.restore_text( params.get( 'homepage_url', '' ) ) + category_ids = util.listify( params.get( 'category_ids[]', '' ) ) + selected_categories = [ trans.security.decode_id( id ) for id in category_ids ] + + repo_type = kwd.get( 'type', rt_util.UNRESTRICTED ) + if repo_type not in rt_util.types: + raise exceptions.RequestParameterInvalidException( 'This repository type is not valid' ) + + invalid_message = repository_util.validate_repository_name( trans.app, name, trans.user ) + if invalid_message: + raise exceptions.RequestParameterInvalidException( invalid_message ) + + repo, message = repository_util.create_repository( app=trans.app, + name=name, + type=repo_type, + description=synopsis, + long_description=description, + user_id = trans.user.id, + category_ids=category_ids, + remote_repository_url=remote_repository_url, + homepage_url=homepage_url ) + + return repo.to_dict( view='element', value_mapper=self.__get_value_mapper( trans ) ) + @web.expose_api def create_changeset_revision( self, trans, id, payload, **kwd ): """ POST /api/repositories/{encoded_repository_id}/changeset_revision Create a new tool shed repository commit - leaving PUT on parent - resource open for updating meta-attirbutes of the repository (and + resource open for updating meta-attributes of the repository (and Galaxy doesn't allow PUT multipart data anyway https://trello.com/c/CQwmCeG6). diff -r a12fc23ff13785d2c2ef7d223dca100ef334ea87 -r 1177b255f17d80190849fc64a5ce9bd88bbe7fd7 lib/galaxy/webapps/tool_shed/buildapp.py --- a/lib/galaxy/webapps/tool_shed/buildapp.py +++ b/lib/galaxy/webapps/tool_shed/buildapp.py @@ -129,6 +129,11 @@ controller='repositories', action='create_changeset_revision', conditions=dict( method=[ "POST" ] ) ) + webapp.mapper.connect( 'create_repository', + '/api/repositories', + controller='repositories', + action='create', + conditions=dict( method=[ "POST" ] ) ) webapp.finalize_config() # Wrap the webapp in some useful middleware diff -r a12fc23ff13785d2c2ef7d223dca100ef334ea87 -r 1177b255f17d80190849fc64a5ce9bd88bbe7fd7 lib/tool_shed/util/repository_util.py --- a/lib/tool_shed/util/repository_util.py +++ b/lib/tool_shed/util/repository_util.py @@ -313,8 +313,11 @@ return associations_dict def validate_repository_name( app, name, user ): - # Repository names must be unique for each user, must be at least four characters - # in length and must contain only lower-case letters, numbers, and the '_' character. + """ + Validate whether the given name qualifies as a new TS repo name. + Repository names must be unique for each user, must be at least two characters + in length and must contain only lower-case letters, numbers, and the '_' character. + """ if name in [ 'None', None, '' ]: return 'Enter the required repository name.' if name in [ 'repos' ]: @@ -322,13 +325,13 @@ check_existing = suc.get_repository_by_name_and_owner( app, name, user.username ) if check_existing is not None: if check_existing.deleted: - return 'You have a deleted repository named <b>%s</b>, so choose a different name.' % name + return 'You own a deleted repository named <b>%s</b>, please choose a different name.' % escape( name ) else: - return "You already have a repository named <b>%s</b>, so choose a different name." % name + return "You already own a repository named <b>%s</b>, please choose a different name." % escape( name ) if len( name ) < 2: return "Repository names must be at least 2 characters in length." if len( name ) > 80: return "Repository names cannot be more than 80 characters in length." if not( VALID_REPOSITORYNAME_RE.match( name ) ): - return "Repository names must contain only lower-case letters, numbers and underscore <b>_</b>." + return "Repository names must contain only lower-case letters, numbers and underscore." return '' https://bitbucket.org/galaxy/galaxy-central/commits/05d1b7925348/ Changeset: 05d1b7925348 User: jmchilton Date: 2015-02-24 20:37:45+00:00 Summary: Fix tool shed-y workflowing for ce1f85a0f09689e86fce1839390a5a00a730321f. Affected #: 1 file diff -r 1177b255f17d80190849fc64a5ce9bd88bbe7fd7 -r 05d1b792534806bd064865d813edcff012dbf81f lib/tool_shed/util/workflow_util.py --- a/lib/tool_shed/util/workflow_util.py +++ b/lib/tool_shed/util/workflow_util.py @@ -6,10 +6,10 @@ import galaxy.tools import galaxy.tools.parameters -import galaxy.webapps.galaxy.controllers.workflow from galaxy.util import json from galaxy.util.sanitize_html import sanitize_html from galaxy.workflow.render import WorkflowCanvas +from galaxy.workflow.steps import attach_ordered_steps from galaxy.workflow.modules import module_types from galaxy.workflow.modules import ToolModule from galaxy.workflow.modules import WorkflowModuleFactory @@ -312,7 +312,7 @@ step.input_connections.append( conn ) del step.temp_input_connections # Order the steps if possible. - galaxy.webapps.galaxy.controllers.workflow.attach_ordered_steps( workflow, steps ) + attach_ordered_steps( workflow, steps ) # Return the in-memory Workflow object for display or later persistence to the Galaxy database. return workflow, missing_tool_tups https://bitbucket.org/galaxy/galaxy-central/commits/20bf9ebc1cd1/ Changeset: 20bf9ebc1cd1 User: carlfeberhard Date: 2015-02-24 22:20:10+00:00 Summary: Fix to layering of dropdown buttons and menus Affected #: 3 files diff -r 05d1b792534806bd064865d813edcff012dbf81f -r 20bf9ebc1cd143d29bb651caf1994f1d9c2db05a static/style/blue/base.css --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -2030,8 +2030,8 @@ .list-panel .controls .list-actions:after{clear:both} .list-panel .controls .list-actions:before,.list-panel .controls .list-actions:after{content:" ";display:table;} .list-panel .controls .list-actions:after{clear:both} -.list-panel .controls .list-actions .btn{padding-top:2px;padding-bottom:2px;font-size:90%;z-index:inherit} -.list-panel .controls .list-actions .list-action-menu{float:right}.list-panel .controls .list-actions .list-action-menu .dropdown-menu{z-index:inherit} +.list-panel .controls .list-actions .btn{padding-top:2px;padding-bottom:2px;font-size:90%} +.list-panel .controls .list-actions .list-action-menu{float:right} .list-panel .list-items .list-item:not(:last-child){border-bottom-width:0px} .list-panel .empty-message{display:none;margin:0px} .list-item .details .list-panel{margin-top:8px;border-radius:3px;background:white;padding:4px}.list-item .details .list-panel .list-items{border:1px solid #bfbfbf;border-radius:3px}.list-item .details .list-panel .list-items .list-item:first-child{border-top-width:0px;border-radius:3px 3px 0px 0px} @@ -2138,9 +2138,10 @@ .multi-panel-history .control-column.control-column-right{text-align:right} .multi-panel-history .outer-middle{overflow:auto} .multi-panel-history .middle{min-width:100%;margin:0px 0px 0px 0px;background-color:white;padding:8px} -.multi-panel-history .history-column{width:312px;margin:0 8px 0 0}.multi-panel-history .history-column:first-child{position:fixed;z-index:2}.multi-panel-history .history-column:first-child .history-panel{border:1px solid black;box-shadow:4px 4px 4px rgba(96,96,96,0.3)} +.multi-panel-history .history-column{width:312px;margin:0 8px 0 0}.multi-panel-history .history-column:first-child{position:fixed;z-index:10}.multi-panel-history .history-column:first-child .history-panel{border:1px solid black;box-shadow:4px 4px 4px rgba(96,96,96,0.3)} .multi-panel-history .history-column:nth-child(2){margin-left:320px} .multi-panel-history .history-column:last-child{margin-right:0px} +.multi-panel-history .history-column .dropdown-menu{z-index:inherit} .multi-panel-history .history-column .panel-controls{width:100%;height:24px;border-radius:3px;background-color:white;text-align:center;flex:0 0 auto;-webkit-align-self:auto;-ms-flex-item-align:auto;align-self:auto}.multi-panel-history .history-column .panel-controls .btn{height:20px;line-height:normal;font-size:90%;padding-top:0px;padding-bottom:0px} .multi-panel-history .history-column .panel-controls .pull-left .btn{margin-right:4px} .multi-panel-history .history-column .panel-controls .pull-right .btn{margin-left:4px} diff -r 05d1b792534806bd064865d813edcff012dbf81f -r 20bf9ebc1cd143d29bb651caf1994f1d9c2db05a static/style/src/less/history.less --- a/static/style/src/less/history.less +++ b/static/style/src/less/history.less @@ -744,7 +744,7 @@ // current history &:first-child { position: fixed; - z-index : 2; + z-index : 10; // visually differentiate the current history .history-panel { @@ -759,6 +759,9 @@ &:last-child { margin-right: 0px; } + .dropdown-menu { + z-index: inherit; + } .panel-controls { width: 100%; diff -r 05d1b792534806bd064865d813edcff012dbf81f -r 20bf9ebc1cd143d29bb651caf1994f1d9c2db05a static/style/src/less/list-item.less --- a/static/style/src/less/list-item.less +++ b/static/style/src/less/list-item.less @@ -167,13 +167,9 @@ padding-top: 2px; padding-bottom: 2px; font-size: 90%; - z-index: inherit; } .list-action-menu { float: right; - .dropdown-menu { - z-index: inherit; - } } } } https://bitbucket.org/galaxy/galaxy-central/commits/658833a7988f/ Changeset: 658833a7988f User: dannon Date: 2015-02-24 23:55:50+00:00 Summary: More tweaks to mutable capabilities, adding back in a copy and stripping pickle from MutationList Affected #: 1 file diff -r 20bf9ebc1cd143d29bb651caf1994f1d9c2db05a -r 658833a7988fe335a5aaaac9709f9e6dfed4a7b2 lib/galaxy/model/custom_types.py --- a/lib/galaxy/model/custom_types.py +++ b/lib/galaxy/model/custom_types.py @@ -1,4 +1,5 @@ import binascii +import copy import json import logging import uuid @@ -62,6 +63,12 @@ else: return self.impl + def copy_value( self, value ): + return copy.deepcopy( value ) + + def compare_values( self, x, y ): + return ( x == y ) + class MutationObj(Mutable): """ @@ -196,12 +203,6 @@ list.remove(self, value) self.changed() - def __getstate__(self): - return list(self) - - def __setstate__(self, state): - self.update(state) - MutationObj.associate_with(JSONType) 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