commit/galaxy-central: 2 new changesets
2 new changesets in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/2b683b63de2e/ changeset: 2b683b63de2e user: John Duddy date: 2011-10-14 23:03:56 summary: Fix API code errors, add ability to set ldda associations, fixed misc error in util affected #: 4 files (-1 bytes) --- a/lib/galaxy/util/__init__.py Fri Oct 14 15:20:12 2011 -0400 +++ b/lib/galaxy/util/__init__.py Fri Oct 14 14:03:56 2011 -0700 @@ -133,6 +133,8 @@ def restore_text(text): """Restores sanitized text""" + if not text: + return text for key, value in mapped_chars.items(): text = text.replace(value, key) return text --- a/lib/galaxy/web/api/histories.py Fri Oct 14 15:20:12 2011 -0400 +++ b/lib/galaxy/web/api/histories.py Fri Oct 14 14:03:56 2011 -0700 @@ -88,9 +88,10 @@ state = states.QUEUED elif summary[states.OK] == num_sets: state = states.OK + item['state_details'] = summary item['contents_url'] = url_for( 'history_contents', history_id=history_id ) + item['state'] = state - item['state_details'] = summary except Exception, e: item = "Error in history API at showing history detail" log.error(item + ": %s" % str(e)) --- a/lib/galaxy/web/api/history_contents.py Fri Oct 14 15:20:12 2011 -0400 +++ b/lib/galaxy/web/api/history_contents.py Fri Oct 14 14:03:56 2011 -0700 @@ -14,7 +14,7 @@ log = logging.getLogger( __name__ ) -class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociation, UsesHistory ): +class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociation, UsesHistory, UsesLibrary, UsesLibraryItems ): @web.expose_api def index( self, trans, history_id, **kwd ): @@ -85,7 +85,7 @@ if from_ld_id: try: - ld = get_library_content_for_access( trans, from_ld_id ) + ld = self.get_library_dataset( trans, from_ld_id, check_ownership=False, check_accessible=False ) assert type( ld ) is trans.app.model.LibraryDataset, "Library content id ( %s ) is not a dataset" % from_ld_id except AssertionError, e: trans.response.status = 400 --- a/lib/galaxy/web/api/library_contents.py Fri Oct 14 15:20:12 2011 -0400 +++ b/lib/galaxy/web/api/library_contents.py Fri Oct 14 14:03:56 2011 -0700 @@ -75,9 +75,9 @@ """ class_name, content_id = self.__decode_library_content_id( trans, id ) if class_name == 'LibraryFolder': - content = self.get_library_folder( trans, content_id, check_ownership=False, check_accessibility=True ) + content = self.get_library_folder( trans, content_id, check_ownership=False, check_accessible=True ) else: - content = self.get_library_dataset( trans, content_id, check_ownership=False, check_accessibility=True ) + content = self.get_library_dataset( trans, content_id, check_ownership=False, check_accessible=True ) return self.encode_all_ids( trans, content.get_api_value( view='element' ) ) @web.expose_api @@ -100,9 +100,10 @@ return "Missing requred 'folder_id' parameter." else: folder_id = payload.pop( 'folder_id' ) + class_name, folder_id = self.__decode_library_content_id( trans, folder_id ) try: # security is checked in the downstream controller - parent = self.get_library_folder( trans, folder_id, check_ownership=False, check_accessibility=False ) + parent = self.get_library_folder( trans, folder_id, check_ownership=False, check_accessible=False ) except Exception, e: return str( e ) # The rest of the security happens in the library_common controller. @@ -128,6 +129,23 @@ url = url_for( 'library_content', library_id=library_id, id=encoded_id ) ) ) return rval + @web.expose_api + def update( self, trans, id, library_id, payload, **kwd ): + """ + PUT /api/libraries/{encoded_library_id}/contents/{encoded_content_type_and_id} + Sets relationships among items + """ + if 'converted_dataset_id' in payload: + converted_id = payload.pop( 'converted_dataset_id' ) + content = self.get_library_dataset( trans, id, check_ownership=False, check_accessible=False ) + content_conv = self.get_library_dataset( trans, converted_id, check_ownership=False, check_accessible=False ) + assoc = trans.app.model.ImplicitlyConvertedDatasetAssociation( parent = content.library_dataset_dataset_association, + dataset = content_conv.library_dataset_dataset_association, + file_type = content_conv.library_dataset_dataset_association.extension, + metadata_safe = True ) + trans.sa_session.add( assoc ) + trans.sa_session.flush() + def __decode_library_content_id( self, trans, content_id ): if ( len( content_id ) % 16 == 0 ): return 'LibraryDataset', content_id http://bitbucket.org/galaxy/galaxy-central/changeset/91d5661608b9/ changeset: 91d5661608b9 user: John Duddy date: 2011-10-14 23:05:15 summary: Correct indentation, only access summary if it is set! affected #: 1 file (-1 bytes) --- a/lib/galaxy/web/api/histories.py Fri Oct 14 14:03:56 2011 -0700 +++ b/lib/galaxy/web/api/histories.py Fri Oct 14 14:05:15 2011 -0700 @@ -88,9 +88,8 @@ state = states.QUEUED elif summary[states.OK] == num_sets: state = states.OK - item['state_details'] = summary + item['state_details'] = summary item['contents_url'] = url_for( 'history_contents', history_id=history_id ) - item['state'] = state except Exception, e: item = "Error in history API at showing history detail" 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