#NEWLINE# def deleteFile( self , file ) : #NEWLINE# #INDENT# '\n        Delete all of the chunks in the collection that correspond to the\n        given file.\n        ' #NEWLINE# q = { #NEWLINE# #INDENT# 'chunkUuid' : file [ 'chunkUuid' ] , #NEWLINE# 'assetstoreId' : file . assetstore [ '_id' ] , #NEWLINE# #UNINDENT# } #NEWLINE# matching = self . model ( 'file' ) . find ( q , limit = 2 , projection = [ ] ) #NEWLINE# if ( matching . count ( True ) == 1 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . chunkColl . delete_many ( { #NEWLINE# #INDENT# 'uuid' : file [ 'chunkUuid' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except pymongo . errors . AutoReconnect : #NEWLINE# #INDENT# pass