#NEWLINE# def Insert( self , insert_request , upload = None ) : #NEWLINE# #INDENT# assert ( upload is not None ) #NEWLINE# generation = 1 #NEWLINE# f = self . get_file ( insert_request . bucket , insert_request . name ) #NEWLINE# if ( f is not None ) : #NEWLINE# #INDENT# generation = ( f . generation + 1 ) #NEWLINE# #UNINDENT# f = FakeFile ( insert_request . bucket , insert_request . name , '' , generation ) #NEWLINE# stream = upload . stream #NEWLINE# data_list = [ ] #NEWLINE# while True : #NEWLINE# #INDENT# data = stream . read ( ( 1024 * 1024 ) ) #NEWLINE# if ( not data ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# data_list . append ( data ) #NEWLINE# #UNINDENT# f . contents = '' . join ( data_list ) #NEWLINE# self . add_file ( f )