ž ¦ÿf™c@sÆdZddddgZddlZddlmZmZddlmZmZdd l m Z dd l m Z Gd d„dƒZ Gd d„de ƒZGd d„dƒZGdd„deƒZdS(u-A parser of RFC 2822 and MIME email messages.uParseru HeaderParseru BytesParseruBytesHeaderParseriN(uStringIOu TextIOWrapper(u FeedParseruBytesFeedParser(uMessage(ucompat32cBsG|EeZdZdeedd„Zd dd„Zd dd„ZdS( uParserupolicycCs||_||_dS(u†Parser of RFC 2822 and MIME email messages. Creates an in-memory object tree representing the email message, which can then be manipulated and turned over to a Generator to return the textual representation of the message. The string must be formatted as a block of RFC 2822 headers and header continuation lines, optionally preceeded by a `Unix-from' header. The header block is terminated either by the end of the string or by a blank line. _class is the class to instantiate for new message objects when they must be created. This class must have a constructor that can take zero arguments. Default is Message.Message. The policy keyword specifies a policy object that controls a number of aspects of the parser's operation. The default policy maintains backward compatibility. N(u_classupolicy(uselfu_classupolicy((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu__init__s uParser.__init__cCsat|jd|jƒ}|r+|jƒnx)|jdƒ}|sGPn|j|ƒq.|jƒS(u\Create a message structure from the data in a file. Reads all the data from the file and returns the root of the message structure. Optional headersonly is a flag specifying whether to stop parsing after reading the headers or not. The default is False, meaning it parses the entire contents of the file. upolicyi (u FeedParseru_classupolicyu_set_headersonlyureadufeeduclose(uselfufpu headersonlyu feedparserudata((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparse+s u Parser.parsecCs|jt|ƒd|ƒS(u-Create a message structure from a string. Returns the root of the message structure. Optional headersonly is a flag specifying whether to stop parsing after reading the headers or not. The default is False, meaning it parses the entire contents of the file. u headersonly(uparseuStringIO(uselfutextu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparsestr=suParser.parsestrNF( u__name__u __module__u __qualname__ucompat32uMessageu__init__uFalseuparseuparsestr(u __locals__((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuParserscBs2|EeZdZddd„Zddd„ZdS(u HeaderParsercCstj||dƒS(NT(uParseruparseuTrue(uselfufpu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparseJsuHeaderParser.parsecCstj||dƒS(NT(uParseruparsestruTrue(uselfutextu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparsestrMsuHeaderParser.parsestrNT(u__name__u __module__u __qualname__uTrueuparseuparsestr(u __locals__((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu HeaderParserIscBs>|EeZdZdd„Zddd„Zddd„ZdS( u BytesParsercOst||Ž|_dS(uÑParser of binary RFC 2822 and MIME email messages. Creates an in-memory object tree representing the email message, which can then be manipulated and turned over to a Generator to return the textual representation of the message. The input must be formatted as a block of RFC 2822 headers and header continuation lines, optionally preceeded by a `Unix-from' header. The header block is terminated either by the end of the input or by a blank line. _class is the class to instantiate for new message objects when they must be created. This class must have a constructor that can take zero arguments. Default is Message.Message. N(uParseruparser(uselfuargsukw((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu__init__SsuBytesParser.__init__c Cs<t|ddddƒ}||jj||ƒSWdQXdS(ucCreate a message structure from the data in a binary file. Reads all the data from the file and returns the root of the message structure. Optional headersonly is a flag specifying whether to stop parsing after reading the headers or not. The default is False, meaning it parses the entire contents of the file. uencodinguasciiuerrorsusurrogateescapeN(u TextIOWrapperuparseruparse(uselfufpu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparseesuBytesParser.parsecCs(|jdddƒ}|jj||ƒS(u2Create a message structure from a byte string. Returns the root of the message structure. Optional headersonly is a flag specifying whether to stop parsing after reading the headers or not. The default is False, meaning it parses the entire contents of the file. uASCIIuerrorsusurrogateescape(udecodeuparseruparsestr(uselfutextu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu parsebytesrsuBytesParser.parsebytesNF(u__name__u __module__u __qualname__u__init__uFalseuparseu parsebytes(u __locals__((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu BytesParserQs  cBs2|EeZdZddd„Zddd„ZdS(uBytesHeaderParsercCstj||ddƒS(Nu headersonlyT(u BytesParseruparseuTrue(uselfufpu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuparsesuBytesHeaderParser.parsecCstj||ddƒS(Nu headersonlyT(u BytesParseru parsebytesuTrue(uselfutextu headersonly((u1/opt/alt/python33/lib64/python3.3/email/parser.pyu parsebytes‚suBytesHeaderParser.parsebytesNT(u__name__u __module__u __qualname__uTrueuparseu parsebytes(u __locals__((u1/opt/alt/python33/lib64/python3.3/email/parser.pyuBytesHeaderParser~s(u__doc__u__all__uwarningsuiouStringIOu TextIOWrapperuemail.feedparseru FeedParseruBytesFeedParseru email.messageuMessageuemail._policybaseucompat32uParseru HeaderParseru BytesParseruBytesHeaderParser(((u1/opt/alt/python33/lib64/python3.3/email/parser.pyus 7-