Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/email/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/email/__pycache__/feedparser.cpython-37.opt-2.pyc

B

YI~d�X�@s�ddgZddlZddlmZddlmZddlmZddlm	Z	e�
d�Ze�
d	�Ze�
d
�Z
e�
d	�Ze�
d�ZdZd
Ze�ZGdd�de�ZGdd�d�ZGdd�de�ZdS)�
FeedParser�BytesFeedParser�N)�errors)�compat32)�deque)�StringIOz
\r\n|\r|\nz(\r\n|\r|\n)z(\r\n|\r|\n)\Zz%^(From |[\041-\071\073-\176]*:|[\t ])��
c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�BufferedSubFilecCs$tdd�|_t�|_g|_d|_dS)Nr)�newlineF)r�_partialr�_lines�	_eofstack�_closed)�self�r�5/opt/alt/python37/lib64/python3.7/email/feedparser.py�__init__5szBufferedSubFile.__init__cCs|j�|�dS)N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|j��S)N)r�pop)rrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|j�d�|�|j���|j�d�|j��d|_dS)NrT)r�seek�	pushlines�	readlines�truncater)rrrr�closeFs

zBufferedSubFile.closecCsN|js|jrdStS|j��}x*t|j�D]}||�r*|j�|�dSq*W|S)Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|j�|�dS)N)r
r )rr!rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|j�|�d|kr d|kr dS|j�d�|j��}|j�d�|j��|d�d�sj|j�|���|�|�dS)Nr	�
r���)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|j�|�dS)N)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|S)Nr)rrrr�__iter__}szBufferedSubFile.__iter__cCs|��}|dkrt�|S)Nr)r"�
StopIteration)rr!rrr�__next__�szBufferedSubFile.__next__N)
�__name__�
__module__�__qualname__rrrrr"r#r*rr-r/rrrrr
-sr
c@s\eZdZded�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)rN)�policycCs�||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_y||jd�Wntk
rld|_YnXt�|_g|_	|�
�j|_d|_
d|_d|_dS)NFr)�Message)r3T)r3�_old_style_factoryZmessage_factoryZ
email.messager4�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr/�_parse�_cur�_last�_headersonly)rr6r3r4rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)r>)rrrr�_set_headersonly�szFeedParser._set_headersonlycCs|j�|�|��dS)N)r8r*�_call_parse)rr(rrr�feed�szFeedParser.feedcCs&y|��Wntk
r YnXdS)N)r;r.)rrrrr@�szFeedParser._call_parsecCsH|j��|��|��}|��dkrD|��sDt��}|j�	||�|S)N�	multipart)
r8rr@�_pop_message�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr3�
handle_defect)r�root�defectrrrr�s
zFeedParser.closecCsn|jr|��}n|j|jd�}|jr<|j��dkr<|�d�|jrR|jd�|�|j�|�||_||_	dS)N)r3zmultipart/digestzmessage/rfc822r%)
r5r6r3r<�get_content_typeZset_default_typer9Zattachrr=)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|j��}|jr|jd|_nd|_|S)Nr%)r9rr<)r�retvalrrrrC�s

zFeedParser._pop_messageccs:|��g}xb|jD]X}|tkr(tVqt�|�sbt�|�s`t��}|j�	|j
|�|j�|�P|�|�qW|�
|�|jr�g}x2|j��}|tkr�tVq�|dkr�P|�|�q�W|j
�t�|��dS|j
��dk�r�x�|j�tj�x$|��D]}|tk�rtVq�Pq�W|��}|j��x&|j��}|tk�rFtV�q(P�q(Wx&|j��}|tk�rntV�qPP�qPW|dk�r�P|j�|�q�WdS|j
��dk�r�x(|��D]}|tk�r�tV�q�P�q�W|��dS|j
��dk�r�|j
��}|dk�rbt��}|j�	|j
|�g}x.|jD]$}|tk�r<tV�q$|�|��q$W|j
�t�|��dSt|j
�dd����dk�r�t��}|j�	|j
|�d|}t� d	t�!|�d
�}	d}
g}d}d}
�x|j��}|tk�r�tV�q�|dk�r�P|	�|�}|�r�|�"d
��r d}
|�"d�}P|
�r�|�rn|d}t#�$|�}|�r`|dt%|�"d���|d<t�|�|j
_&d}
|j�|��q�xB|j��}|tk�r�tV�q�|	�|�}|�s�|j�|�P�q�W|j�|	j�x(|��D]}|tk�r�tV�q�P�q�W|j'��dk�rf|j'j(}|dk�r*d|j'_(n:|dk	�r�t#�$|�}|�r�t%|�"d��}|d|�|j'_(nD|j'j)}t*|t��r�t#�$|�}|�r�|dt%|�"d���}||j'_)|j��|��|j
|_'n
|�|��q�W|
�rBt�+�}|j�	|j
|�|j
�t�|��g}x$|jD]}|tk�rtV�q�qWt�|�|j
_(dS|
�sdt�,�}|j�	|j
|�dS|�rrdg}ng}x.|jD]$}|tk�r�tV�q~|�|��q~W|�r�|d}t-�|�}|�r�|t%|�"d��d�|d<t�|�|j
_(dSg}x.|jD]$}|tk�rtV�q�|�|��q�W|j
�t�|��dS)Nrzmessage/delivery-status�messagerBzcontent-transfer-encoding�8bit)Z7bitrMZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr%r).rJr8r�headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr3rEr<r#r�_parse_headersr>r"Zset_payload�EMPTYSTRING�joinrHrr:rCrrDZget_boundaryZNoBoundaryInMultipartDefect�str�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preambler=�epilogueZ_payload�
isinstanceZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr!rGr,rKrI�boundaryZ	separatorZ
boundaryreZcapturing_preambler`rOZclose_boundary_seen�moZlastlineZeolmorarNZpayload�	firstlineZbolmorrrr:�sf




































zFeedParser._parsegenc	Cs\d}g}�x2t|�D�]$\}}|ddkrV|sJt�|�}|j�|j|�q|�|�q|rx|jj|j�|��dg}}|�	d�r�|dkr�t
�|�}|r�|dt|�
d���}|j�|�qn:|t|�dkr�|j�|�dSt�|�}|jj�|�q|�d�}|dk�r(t�d�}|jj�|�q|d|�}|g}qW|�rX|jj|j�|��dS)Nrrz 	zFrom ��:zMissing header name.)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr3rEr<rZset_rawZheader_source_parse�
startswithr]r^r_r\Zset_unixfromr8r#ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefect)	rr,Z
lastheaderZ	lastvalue�linenor!rGre�irrrrS�sF









zFeedParser._parse_headers)N)
r0r1r2rrr?rAr@rrJrCr:rSrrrrr�s

~cseZdZ�fdd�Z�ZS)rcst��|�dd��dS)N�ascii�surrogateescape)�superrA�decode)rr()�	__class__rrrAszBytesFeedParser.feed)r0r1r2rA�
__classcell__rr)rrrrs)�__all__rYZemailrZemail._policybaser�collectionsr�iorrZrRrcr]ZNLCRE_crackrPrT�NL�objectrr
rrrrrr�<module>s&




[

Hacked By AnonymousFox1.0, Coded By AnonymousFox