2001-09-23 00:17:28 -03:00
|
|
|
|
# Copyright (C) 2001 Python Software Foundation
|
|
|
|
|
# Author: barry@zope.com (Barry Warsaw)
|
|
|
|
|
|
|
|
|
|
"""Base class for MIME specializations.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import Message
|
|
|
|
|
|
|
|
|
|
|
2001-10-04 14:05:11 -03:00
|
|
|
|
|
2001-09-23 00:17:28 -03:00
|
|
|
|
class MIMEBase(Message.Message):
|
|
|
|
|
"""Base class for MIME specializations."""
|
|
|
|
|
|
2001-09-26 02:36:36 -03:00
|
|
|
|
def __init__(self, _maintype, _subtype, **_params):
|
2001-09-23 00:17:28 -03:00
|
|
|
|
"""This constructor adds a Content-Type: and a MIME-Version: header.
|
|
|
|
|
|
2001-09-26 02:36:36 -03:00
|
|
|
|
The Content-Type: header is taken from the _maintype and _subtype
|
2001-09-23 00:17:28 -03:00
|
|
|
|
arguments. Additional parameters for this header are taken from the
|
|
|
|
|
keyword arguments.
|
|
|
|
|
"""
|
|
|
|
|
Message.Message.__init__(self)
|
2001-09-26 02:36:36 -03:00
|
|
|
|
ctype = '%s/%s' % (_maintype, _subtype)
|
2001-09-23 00:17:28 -03:00
|
|
|
|
self.add_header('Content-Type', ctype, **_params)
|
|
|
|
|
self['MIME-Version'] = '1.0'
|