home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 July / maximum-cd-2011-07.iso / DiscContents / LibO_3.3.2_Win_x86_install_multi.exe / libreoffice1.cab / base.py < prev    next >
Encoding:
Python Source  |  2011-03-15  |  794 b   |  27 lines

  1. # Copyright (C) 2001-2006 Python Software Foundation
  2. # Author: Barry Warsaw
  3. # Contact: email-sig@python.org
  4.  
  5. """Base class for MIME specializations."""
  6.  
  7. __all__ = ['MIMEBase']
  8.  
  9. from email import message
  10.  
  11.  
  12.  
  13. class MIMEBase(message.Message):
  14.     """Base class for MIME specializations."""
  15.  
  16.     def __init__(self, _maintype, _subtype, **_params):
  17.         """This constructor adds a Content-Type: and a MIME-Version: header.
  18.  
  19.         The Content-Type: header is taken from the _maintype and _subtype
  20.         arguments.  Additional parameters for this header are taken from the
  21.         keyword arguments.
  22.         """
  23.         message.Message.__init__(self)
  24.         ctype = '%s/%s' % (_maintype, _subtype)
  25.         self.add_header('Content-Type', ctype, **_params)
  26.         self['MIME-Version'] = '1.0'
  27.