blob: 81cc4dc1b45a207b8f4acf6389b9c112db3d065b [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"""Class for generating message/rfc822 MIME documents.
5"""
6
7import Message
8import MIMEBase
9
10
11
12class MessageRFC822(MIMEBase.MIMEBase):
13 """Class for generating message/rfc822 MIME documents."""
14
15 def __init__(self, _msg):
16 """Create a message/rfc822 type MIME document.
17
18 _msg is a message object and must be an instance of Message, or a
19 derived class of Message, otherwise a TypeError is raised.
20 """
21 MIMEBase.MIMEBase.__init__(self, 'message', 'rfc822')
22 if not isinstance(_msg, Message.Message):
23 raise TypeError, 'Argument is not an instance of Message'
24 self.set_payload(_msg)