diff options
author | Barry Warsaw <barry@python.org> | 2001-09-23 03:17:28 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-09-23 03:17:28 +0000 |
commit | ba92580f01b47ba1468c382961ed5122654c2520 (patch) | |
tree | 413464c274da1a93dc99d0a1cf13baf9a99c3220 /Lib/email/MessageRFC822.py | |
parent | d61d0d3f6dbd960a761c05ff7fea848cb6490aa3 (diff) | |
download | cpython-git-ba92580f01b47ba1468c382961ed5122654c2520.tar.gz |
The email package version 1.0, prototyped as mimelib
<http://sf.net/projects/mimelib>. There /are/ API differences between
mimelib and email, but most of the implementations are shared (except
where cool Py2.2 stuff like generators are used).
Diffstat (limited to 'Lib/email/MessageRFC822.py')
-rw-r--r-- | Lib/email/MessageRFC822.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/email/MessageRFC822.py b/Lib/email/MessageRFC822.py new file mode 100644 index 0000000000..81cc4dc1b4 --- /dev/null +++ b/Lib/email/MessageRFC822.py @@ -0,0 +1,24 @@ +# Copyright (C) 2001 Python Software Foundation +# Author: barry@zope.com (Barry Warsaw) + +"""Class for generating message/rfc822 MIME documents. +""" + +import Message +import MIMEBase + + + +class MessageRFC822(MIMEBase.MIMEBase): + """Class for generating message/rfc822 MIME documents.""" + + def __init__(self, _msg): + """Create a message/rfc822 type MIME document. + + _msg is a message object and must be an instance of Message, or a + derived class of Message, otherwise a TypeError is raised. + """ + MIMEBase.MIMEBase.__init__(self, 'message', 'rfc822') + if not isinstance(_msg, Message.Message): + raise TypeError, 'Argument is not an instance of Message' + self.set_payload(_msg) |