source: vendor/python/2.5/Lib/email/mime/base.py@ 3225

Last change on this file since 3225 was 3225, checked in by bird, 19 years ago

Python 2.5

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