2002-04-10 18:01:31 -03:00
|
|
|
|
# Copyright (C) 2001,2002 Python Software Foundation
|
2001-09-23 00:17:28 -03:00
|
|
|
|
# Author: barry@zope.com (Barry Warsaw)
|
|
|
|
|
|
|
|
|
|
"""A package for parsing, handling, and generating email messages.
|
|
|
|
|
"""
|
|
|
|
|
|
2002-06-01 03:03:09 -03:00
|
|
|
|
__version__ = '2.0.5'
|
2001-09-23 00:17:28 -03:00
|
|
|
|
|
2002-04-10 18:01:31 -03:00
|
|
|
|
__all__ = ['Charset',
|
|
|
|
|
'Encoders',
|
2001-09-23 00:17:28 -03:00
|
|
|
|
'Errors',
|
|
|
|
|
'Generator',
|
2002-04-10 18:01:31 -03:00
|
|
|
|
'Header',
|
2001-09-23 00:17:28 -03:00
|
|
|
|
'Iterators',
|
2001-10-09 16:14:59 -03:00
|
|
|
|
'MIMEAudio',
|
2001-09-23 00:17:28 -03:00
|
|
|
|
'MIMEBase',
|
2001-10-09 16:14:59 -03:00
|
|
|
|
'MIMEImage',
|
|
|
|
|
'MIMEMessage',
|
|
|
|
|
'MIMEText',
|
2001-09-23 00:17:28 -03:00
|
|
|
|
'Message',
|
|
|
|
|
'Parser',
|
|
|
|
|
'Utils',
|
2002-04-10 18:01:31 -03:00
|
|
|
|
'base64MIME',
|
|
|
|
|
'quopriMIME',
|
2001-09-23 00:17:28 -03:00
|
|
|
|
'message_from_string',
|
|
|
|
|
'message_from_file',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2001-10-04 14:05:11 -03:00
|
|
|
|
|
2001-09-23 00:17:28 -03:00
|
|
|
|
# Some convenience routines
|
2002-06-01 03:03:09 -03:00
|
|
|
|
from email.Parser import Parser as _Parser
|
|
|
|
|
from email.Message import Message as _Message
|
2001-09-23 00:17:28 -03:00
|
|
|
|
|
|
|
|
|
def message_from_string(s, _class=_Message):
|
|
|
|
|
return _Parser(_class).parsestr(s)
|
|
|
|
|
|
|
|
|
|
def message_from_file(fp, _class=_Message):
|
|
|
|
|
return _Parser(_class).parse(fp)
|