Hacked By AnonymousFox
��Yf�Y � @ s d Z d d g Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l
m Z e j d
� Z
e j d � Z e j d � Z e j d � Z e j d
� Z d Z d Z e � Z Gd d � d e � Z Gd d � d � Z Gd d � d e � Z d S)a FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
those reading email messages off a socket.
FeedParser.feed() is the primary interface for pushing new data into the
parser. It returns when there's nothing more it can do with the available
data. When you have no more data to push into the parser, call .close().
This completes the parsing and returns the root message object.
The other advantage of this parser is that it will never raise a parsing
exception. Instead, when it finds something unexpected, it adds a 'defect' to
the current message. Defects are just instances that live on the message
object's .defects attribute.
�
FeedParser�BytesFeedParser� N)�errors)�message)�compat32)�deque)�StringIOz
|
|
z(
|
|
)z
(
|
|
)\Zz%^(From |[\041-\071\073-\176]*:|[\t ])� �
c @ s� e Z d Z d Z d d � Z d d � Z d d � Z d d � Z d
d � Z d d
� Z d d � Z
d d � Z d d � Z d d � Z
d S)�BufferedSubFileak A file-ish object that can have new data loaded into it.
You can also push and pop line-matching predicates onto a stack. When the
current predicate matches the current line, a false EOF response
(i.e. empty string) is returned instead. This lets the parser adhere to a
simple abstraction -- it parses until EOF closes the current message.
c C s4 t d d � | _ t � | _ g | _ d | _ d S)N�newliner F)r �_partialr �_lines� _eofstack�_closed)�self� r �5/opt/alt/python35/lib64/python3.5/email/feedparser.py�__init__6 s zBufferedSubFile.__init__c C s | j j | � d S)N)r �append)r Zpredr r r �push_eof_matcherA s z BufferedSubFile.push_eof_matcherc C s
| j j � S)N)r �pop)r r r r �pop_eof_matcherD s zBufferedSubFile.pop_eof_matcherc C sP | j j d � | j | j j � � | j j d � | j j � d | _ d S)Nr T)r
�seek� pushlines� readlines�truncater )r r r r �closeG s
zBufferedSubFile.closec C sg | j s | j r d St S| j j � } x7 t | j � D]&