#NEWLINE# def _create_attachment( self , filename , content , mimetype = None ) : #NEWLINE# #INDENT# '\n        Converts the filename, content, mimetype triple into a MIME attachment\n        object.\n        ' #NEWLINE# if ( mimetype is None ) : #NEWLINE# #INDENT# ( mimetype , _ ) = mimetypes . guess_type ( filename ) #NEWLINE# if ( mimetype is None ) : #NEWLINE# #INDENT# mimetype = DEFAULT_ATTACHMENT_MIME_TYPE #NEWLINE# #UNINDENT# #UNINDENT# attachment = self . _create_mime_attachment ( content , content ) #NEWLINE# if filename : #NEWLINE# #INDENT# attachment . add_header ( 'Content-Disposition' , 'attachment' , filename = filename ) #NEWLINE# #UNINDENT# return attachment