1 # Copyright (C) 2001,2002 Python Software Foundation
2 # Author: barry@zope.com (Barry Warsaw)
4 """Base class for MIME specializations.
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
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'