#NEWLINE# def stop( self ) : #NEWLINE# #INDENT# 'Stop creating the stream. Create the terminating zero-length blob.' #NEWLINE# log . debug ( 'stop has been called for StreamCreator' ) #NEWLINE# self . stopped = True #NEWLINE# if ( self . current_blob is not None ) : #NEWLINE# #INDENT# current_blob = dl . current_blob #NEWLINE# d = current_blob . close ( ) #NEWLINE# d . addCallback ( self . _blob_finished ) #NEWLINE# self . finished_deferreds . append ( d ) #NEWLINE# self . current_blob = None #NEWLINE# #UNINDENT# self . _finalize ( ) #NEWLINE# dl = defer . DeferredList ( self . finished_deferreds ) #NEWLINE# dl . addCallback ( ( lambda _ : self . _finished ( ) ) ) #NEWLINE# return dl