#NEWLINE# def add_file( self , fieldname , filename , fd , mimetype = None ) : #NEWLINE# #INDENT# body = fd . read ( ) #NEWLINE# if ( mimetype is None ) : #NEWLINE# #INDENT# mimetype = ( guess_type ( fieldname ) [ 0 ] or 'application/octet-stream' ) #NEWLINE# #UNINDENT# self . files . append ( ( fieldname , filename , mimetype , body ) )