This commit was manufactured by cvs2svn to create tag 'r222'.
[python/dscho.git] / Lib / email / MIMEBase.py
blob7485d855c4fa022b68f34fdea073101162ec6519
1 # Copyright (C) 2001,2002 Python Software Foundation
2 # Author: barry@zope.com (Barry Warsaw)
4 """Base class for MIME specializations.
5 """
7 from email import Message
11 class MIMEBase(Message.Message):
12 """Base class for MIME specializations."""
14 def __init__(self, _maintype, _subtype, **_params):
15 """This constructor adds a Content-Type: and a MIME-Version: header.
17 The Content-Type: header is taken from the _maintype and _subtype
18 arguments. Additional parameters for this header are taken from the
19 keyword arguments.
20 """
21 Message.Message.__init__(self)
22 ctype = '%s/%s' % (_maintype, _subtype)
23 self.add_header('Content-Type', ctype, **_params)
24 self['MIME-Version'] = '1.0'