#NEWLINE# def DeleteBlob( self , blob_key ) : #NEWLINE# #INDENT# 'Delete blob data from the datastore.\n\n    Args:\n      blob_key: Blob-key of existing blob to delete.\n    Raises:\n      ApplicationError: When a blob is not found or unable to be read.  \n    ' #NEWLINE# blob_info_key = datastore . Key . from_path ( blobstore . BLOB_INFO_KIND , str ( blob_key ) , namespace = '' ) #NEWLINE# try : #NEWLINE# #INDENT# blob_info = datastore . Get ( blob_info_key ) #NEWLINE# #UNINDENT# except datastore_errors . EntityNotFoundError : #NEWLINE# #INDENT# raise apiproxy_errors . ApplicationError ( blobstore_service_pb . BlobstoreServiceError . BLOB_NOT_FOUND ) #NEWLINE# #UNINDENT# block_count = ( blob_info [ 'size' ] / blobstore . MAX_BLOB_FETCH_SIZE ) #NEWLINE# block_set = [ ] #NEWLINE# try : #NEWLINE# #INDENT# while ( block_count >= 0 ) : #NEWLINE# #INDENT# entity = datastore . Entity ( _BLOB_CHUNK_KIND_ , name = ( ( str ( blob_key ) + '__' ) + str ( block_count ) ) , namespace = '' ) #NEWLINE# block_set . append ( entity ) #NEWLINE# block_count -= 1 #NEWLINE# #UNINDENT# datastore . Delete ( block_set ) #NEWLINE# datastore . Delete ( blob_info_key ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# raise apiproxy_errors . ApplicationError ( blobstore_service_pb . BlobstoreServiceError . BLOB_NOT_FOUND )