Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python3..../email
File: __init__.py
# Copyright (C) 2001-2007 Python Software Foundation
[0] Fix | Delete
# Author: Barry Warsaw
[1] Fix | Delete
# Contact: email-sig@python.org
[2] Fix | Delete
[3] Fix | Delete
"""A package for parsing, handling, and generating email messages."""
[4] Fix | Delete
[5] Fix | Delete
__all__ = [
[6] Fix | Delete
'base64mime',
[7] Fix | Delete
'charset',
[8] Fix | Delete
'encoders',
[9] Fix | Delete
'errors',
[10] Fix | Delete
'feedparser',
[11] Fix | Delete
'generator',
[12] Fix | Delete
'header',
[13] Fix | Delete
'iterators',
[14] Fix | Delete
'message',
[15] Fix | Delete
'message_from_file',
[16] Fix | Delete
'message_from_binary_file',
[17] Fix | Delete
'message_from_string',
[18] Fix | Delete
'message_from_bytes',
[19] Fix | Delete
'mime',
[20] Fix | Delete
'parser',
[21] Fix | Delete
'quoprimime',
[22] Fix | Delete
'utils',
[23] Fix | Delete
]
[24] Fix | Delete
[25] Fix | Delete
[26] Fix | Delete
[27] Fix | Delete
# Some convenience routines. Don't import Parser and Message as side-effects
[28] Fix | Delete
# of importing email since those cascadingly import most of the rest of the
[29] Fix | Delete
# email package.
[30] Fix | Delete
def message_from_string(s, *args, **kws):
[31] Fix | Delete
"""Parse a string into a Message object model.
[32] Fix | Delete
[33] Fix | Delete
Optional _class and strict are passed to the Parser constructor.
[34] Fix | Delete
"""
[35] Fix | Delete
from email.parser import Parser
[36] Fix | Delete
return Parser(*args, **kws).parsestr(s)
[37] Fix | Delete
[38] Fix | Delete
def message_from_bytes(s, *args, **kws):
[39] Fix | Delete
"""Parse a bytes string into a Message object model.
[40] Fix | Delete
[41] Fix | Delete
Optional _class and strict are passed to the Parser constructor.
[42] Fix | Delete
"""
[43] Fix | Delete
from email.parser import BytesParser
[44] Fix | Delete
return BytesParser(*args, **kws).parsebytes(s)
[45] Fix | Delete
[46] Fix | Delete
def message_from_file(fp, *args, **kws):
[47] Fix | Delete
"""Read a file and parse its contents into a Message object model.
[48] Fix | Delete
[49] Fix | Delete
Optional _class and strict are passed to the Parser constructor.
[50] Fix | Delete
"""
[51] Fix | Delete
from email.parser import Parser
[52] Fix | Delete
return Parser(*args, **kws).parse(fp)
[53] Fix | Delete
[54] Fix | Delete
def message_from_binary_file(fp, *args, **kws):
[55] Fix | Delete
"""Read a binary file and parse its contents into a Message object model.
[56] Fix | Delete
[57] Fix | Delete
Optional _class and strict are passed to the Parser constructor.
[58] Fix | Delete
"""
[59] Fix | Delete
from email.parser import BytesParser
[60] Fix | Delete
return BytesParser(*args, **kws).parse(fp)
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function