#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def __flush_data( self , data ) : #NEWLINE# #INDENT# 'Flush `data` to a chunk.\n        ' #NEWLINE# if data : #NEWLINE# #INDENT# assert ( len ( data ) <= self . chunk_size ) #NEWLINE# chunk = { #NEWLINE# #INDENT# 'files_id' : self . _file [ '_id' ] , #NEWLINE# 'n' : self . _chunk_number , #NEWLINE# 'data' : Binary ( data ) , #NEWLINE# #UNINDENT# } #NEWLINE# ( yield self . _chunks . insert ( chunk ) ) #NEWLINE# self . _chunk_number += 1 #NEWLINE# self . _position += len ( data )