1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8717485b3c6c/ changeset: 8717485b3c6c user: greg date: 2013-02-21 21:04:14 summary: Minor fixes to the baseline API methods in the tool shed. affected #: 3 files diff -r 73914d7ce26131b0670f82e3596d2a56494f0480 -r 8717485b3c6c78f709d352a63255e50ef978f57d lib/galaxy/webapps/community/api/repositories.py --- a/lib/galaxy/webapps/community/api/repositories.py +++ b/lib/galaxy/webapps/community/api/repositories.py @@ -26,7 +26,9 @@ .order_by( trans.app.model.Repository.table.c.name ) \ .all() for repository in query: - item = repository.get_api_value( value_mapper={ 'id' : trans.security.encode_id( repository.id ) } ) + value_mapper={ 'id' : trans.security.encode_id( repository.id ), + 'user_id' : trans.security.encode_id( repository.user_id ) } + item = repository.get_api_value( view='collection', value_mapper=value_mapper ) item[ 'url' ] = web.url_for( 'repository_contents', repository_id=trans.security.encode_id( repository.id ) ) rval.append( item ) except Exception, e: @@ -43,7 +45,9 @@ """ try: repository = suc.get_repository_in_tool_shed( trans, id ) - repository_data = repository.get_api_value( view='element', value_mapper={ 'id' : trans.security.encode_id( repository.id ) } ) + value_mapper={ 'id' : trans.security.encode_id( repository.id ), + 'user_id' : trans.security.encode_id( repository.user_id ) } + repository_data = repository.get_api_value( view='element', value_mapper=value_mapper ) repository_data[ 'contents_url' ] = web.url_for( 'repository_contents', repository_id=id ) except Exception, e: message = "Error in the Tool Shed API at show: %s" % str( e ) diff -r 73914d7ce26131b0670f82e3596d2a56494f0480 -r 8717485b3c6c78f709d352a63255e50ef978f57d lib/galaxy/webapps/community/api/repository_revisions.py --- a/lib/galaxy/webapps/community/api/repository_revisions.py +++ b/lib/galaxy/webapps/community/api/repository_revisions.py @@ -26,7 +26,9 @@ .order_by( trans.app.model.RepositoryMetadata.table.c.repository_id ) \ .all() for repository_metadata in query: - item = repository_metadata.get_api_value( value_mapper={ 'id' : trans.security.encode_id( repository_metadata.id ) } ) + value_mapper={ 'id' : trans.security.encode_id( repository_metadata.id ), + 'repository_id' : trans.security.encode_id( repository_metadata.repository_id ) } + item = repository_metadata.get_api_value( view='collection', value_mapper=value_mapper ) item[ 'url' ] = web.url_for( 'repository_revision', id=trans.security.encode_id( repository_metadata.id ) ) rval.append( item ) except Exception, e: diff -r 73914d7ce26131b0670f82e3596d2a56494f0480 -r 8717485b3c6c78f709d352a63255e50ef978f57d lib/galaxy/webapps/community/model/__init__.py --- a/lib/galaxy/webapps/community/model/__init__.py +++ b/lib/galaxy/webapps/community/model/__init__.py @@ -114,14 +114,14 @@ self.prev_session_id = prev_session_id class Repository( object, APIItem ): - api_collection_visible_keys = ( 'id', 'name', 'description', 'user_id', 'private', 'times_downloaded', 'deprecated' ) - api_element_visible_keys = ( 'id', 'name', 'description', 'long_description', 'user_id', 'private', 'times_downloaded', 'deprecated' ) + api_collection_visible_keys = ( 'id', 'name', 'description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated' ) + api_element_visible_keys = ( 'id', 'name', 'description', 'long_description', 'user_id', 'private', 'deleted', 'times_downloaded', 'deprecated' ) file_states = Bunch( NORMAL = 'n', NEEDS_MERGING = 'm', MARKED_FOR_REMOVAL = 'r', MARKED_FOR_ADDITION = 'a', NOT_TRACKED = '?' ) - def __init__( self, id=None, name=None, description=None, long_description=None, user_id=None, private=False, email_alerts=None, + def __init__( self, id=None, name=None, description=None, long_description=None, user_id=None, private=False, deleted=None, email_alerts=None, times_downloaded=0, deprecated=False ): self.id = id self.name = name or "Unnamed repository" @@ -129,12 +129,14 @@ self.long_description = long_description self.user_id = user_id self.private = private + self.deleted = deleted self.email_alerts = email_alerts self.times_downloaded = times_downloaded self.deprecated = deprecated def as_dict( self, trans ): - repository_dict = self.get_api_value( view='element' ) - repository_dict[ 'id' ] = trans.security.encode_id( self.id ) + value_mapper={ 'id' : trans.security.encode_id( self.id ), + 'user_id' : trans.security.encode_id( self.user_id ) } + repository_dict = self.get_api_value( view='element', value_mapper=value_mapper ) return repository_dict def get_api_value( self, view='collection', value_mapper=None ): if value_mapper is None: 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.