Staging
v0.8.1
https://github.com/python/cpython
Revision 3a833f748fc629d25a5af3faeef91447f4709804 authored by cvs2svn on 30 November 2004, 01:49:18 UTC, committed by cvs2svn on 30 November 2004, 01:49:18 UTC
1 parent e9d719b
Raw File
Tip revision: 3a833f748fc629d25a5af3faeef91447f4709804 authored by cvs2svn on 30 November 2004, 01:49:18 UTC
This commit was manufactured by cvs2svn to create tag 'r24'.
Tip revision: 3a833f7
MIMEBase.py
# Copyright (C) 2001-2004 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Base class for MIME specializations."""

from email import Message



class MIMEBase(Message.Message):
    """Base class for MIME specializations."""

    def __init__(self, _maintype, _subtype, **_params):
        """This constructor adds a Content-Type: and a MIME-Version: header.

        The Content-Type: header is taken from the _maintype and _subtype
        arguments.  Additional parameters for this header are taken from the
        keyword arguments.
        """
        Message.Message.__init__(self)
        ctype = '%s/%s' % (_maintype, _subtype)
        self.add_header('Content-Type', ctype, **_params)
        self['MIME-Version'] = '1.0'
back to top