# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """A package for parsing, handling, and generating email messages.""" __version__ = '4.0.3' __all__ = [ # Old names 'base64MIME', 'Charset', 'Encoders', 'Errors', 'Generator', 'Header', 'Iterators', 'Message', 'MIMEAudio', 'MIMEBase', 'MIMEImage', 'MIMEMessage', 'MIMEMultipart', 'MIMENonMultipart', 'MIMEText', 'Parser', 'quopriMIME', 'Utils', 'message_from_string', 'message_from_file', # new names 'base64mime', 'charset', 'encoders', 'errors', 'generator', 'header', 'iterators', 'message', 'mime', 'parser', 'quoprimime', 'utils', ] # Some convenience routines. Don't import Parser and Message as side-effects # of importing email since those cascadingly import most of the rest of the # email package. def message_from_string(s, *args, **kws): """Parse a string into a Message object model. Optional _class and strict are passed to the Parser constructor. """ from email.parser import Parser return Parser(*args, **kws).parsestr(s) def message_from_file(fp, *args, **kws): """Read a file and parse its contents into a Message object model. Optional _class and strict are passed to the Parser constructor. """ from email.parser import Parser return Parser(*args, **kws).parse(fp) # Lazy loading to provide name mapping from new-style names (PEP 8 compatible # email 4.0 module names), to old-style names (email 3.0 module names). import sys class LazyImporter(object): def __init__(self, module_name): self.__name__ = 'email.' + module_name def __getattr__(self, name): __import__(self.__name__) mod = sys.modules[self.__name__] self.__dict__.update(mod.__dict__) return getattr(mod, name) _LOWERNAMES = [ # email.<old name> -> email.<new name is lowercased old name> 'Charset', 'Encoders', 'Errors', 'FeedParser', 'Generator', 'Header', 'Iterators', 'Message', 'Parser', 'Utils', 'base64MIME', 'quopriMIME', ] _MIMENAMES = [ # email.MIME<old name> -> email.mime.<new name is lowercased old name> 'Audio', 'Base', 'Image', 'Message', 'Multipart', 'NonMultipart', 'Text', ] for _name in _LOWERNAMES: importer = LazyImporter(_name.lower()) sys.modules['email.' + _name] = importer setattr(sys.modules['email'], _name, importer) import email.mime for _name in _MIMENAMES: importer = LazyImporter('mime.' + _name.lower()) sys.modules['email.MIME' + _name] = importer setattr(sys.modules['email'], 'MIME' + _name, importer) setattr(sys.modules['email.mime'], _name, importer)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
mime | Folder | 0755 |
|
|
__init__.py | File | 2.79 KB | 0644 |
|
__init__.pyc | File | 2.8 KB | 0644 |
|
__init__.pyo | File | 2.8 KB | 0644 |
|
_parseaddr.py | File | 15.76 KB | 0644 |
|
_parseaddr.pyc | File | 13.57 KB | 0644 |
|
_parseaddr.pyo | File | 13.57 KB | 0644 |
|
base64mime.py | File | 5.66 KB | 0644 |
|
base64mime.pyc | File | 5.2 KB | 0644 |
|
base64mime.pyo | File | 5.2 KB | 0644 |
|
charset.py | File | 15.67 KB | 0644 |
|
charset.pyc | File | 13.22 KB | 0644 |
|
charset.pyo | File | 13.18 KB | 0644 |
|
encoders.py | File | 1.97 KB | 0644 |
|
encoders.pyc | File | 2.18 KB | 0644 |
|
encoders.pyo | File | 2.18 KB | 0644 |
|
errors.py | File | 1.59 KB | 0644 |
|
errors.pyc | File | 3.45 KB | 0644 |
|
errors.pyo | File | 3.45 KB | 0644 |
|
feedparser.py | File | 20.01 KB | 0644 |
|
feedparser.pyc | File | 10.88 KB | 0644 |
|
feedparser.pyo | File | 10.79 KB | 0644 |
|
generator.py | File | 13.87 KB | 0644 |
|
generator.pyc | File | 10.14 KB | 0644 |
|
generator.pyo | File | 10.14 KB | 0644 |
|
header.py | File | 21.72 KB | 0644 |
|
header.pyc | File | 13.34 KB | 0644 |
|
header.pyo | File | 13.27 KB | 0644 |
|
iterators.py | File | 2.15 KB | 0644 |
|
iterators.pyc | File | 2.31 KB | 0644 |
|
iterators.pyo | File | 2.31 KB | 0644 |
|
message.py | File | 30 KB | 0644 |
|
message.pyc | File | 28 KB | 0644 |
|
message.pyo | File | 28 KB | 0644 |
|
parser.py | File | 3.22 KB | 0644 |
|
parser.pyc | File | 3.74 KB | 0644 |
|
parser.pyo | File | 3.74 KB | 0644 |
|
quoprimime.py | File | 10.59 KB | 0644 |
|
quoprimime.pyc | File | 8.64 KB | 0644 |
|
quoprimime.pyo | File | 8.64 KB | 0644 |
|
utils.py | File | 9.79 KB | 0644 |
|
utils.pyc | File | 9.11 KB | 0644 |
|
utils.pyo | File | 9.11 KB | 0644 |
|