#NEWLINE# def _handle_message_delivery_status( self , msg ) : #NEWLINE# #INDENT# blocks = [ ] #NEWLINE# for part in msg . get_payload ( ) : #NEWLINE# #INDENT# s = StringIO ( ) #NEWLINE# g = self . clone ( s ) #NEWLINE# g . flatten ( part , unixfrom = False ) #NEWLINE# text = s . getvalue ( ) #NEWLINE# lines = text . split ( '\n' ) #NEWLINE# if ( lines and ( lines [ ( - 1 ) ] == '' ) ) : #NEWLINE# #INDENT# blocks . append ( NL . join ( lines [ : ( - 1 ) ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# blocks . append ( text ) #NEWLINE# #UNINDENT# #UNINDENT# self . _fp . write ( NL . join ( blocks ) )