blob: e6dda56814c9419f2500bd196919f14107cdff87 [file] [log] [blame]
Barry Warsawba925802001-09-23 03:17:28 +00001# Copyright (C) 2001 Python Software Foundation
2# Author: barry@zope.com (Barry Warsaw)
3
4"""Base class for MIME specializations.
5"""
6
7import Message
8
9
10
11class MIMEBase(Message.Message):
12 """Base class for MIME specializations."""
13
14 def __init__(self, _major, _minor, **_params):
15 """This constructor adds a Content-Type: and a MIME-Version: header.
16
17 The Content-Type: header is taken from the _major and _minor
18 arguments. Additional parameters for this header are taken from the
19 keyword arguments.
20 """
21 Message.Message.__init__(self)
22 ctype = '%s/%s' % (_major, _minor)
23 self.add_header('Content-Type', ctype, **_params)
24 self['MIME-Version'] = '1.0'