ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/email/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/email/__pycache__/feedparser.cpython-36.opt-2.pyc

3

��2a�X�@s�ddgZddlZddlmZddlmZddlmZddlm	Z	ej
d�Zej
d	�Zej
d
�Z
ej
d	�Zej
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�//opt/alt/python36/lib64/python3.6/feedparser.py�__init__5szBufferedSubFile.__init__cCs|jj|�dS)N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|jj�S)N)r�pop)rrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|jjd�|j|jj��|jjd�|jj�d|_dS)NrT)r�seek�	pushlines�	readlines�truncater)rrrr�closeFs

zBufferedSubFile.closecCsN|js|jrdStS|jj�}x*t|j�D]}||�r*|jj|�dSq*W|S)Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|jj|�dS)N)r
r )rr!rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|jj|�d|kr d|kr dS|jjd�|jj�}|jjd�|jj�|djd�sj|jj|j��|j|�dS)Nr	�
r����)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|jj|�dS)N)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|S)Nr)rrrr�__iter__}szBufferedSubFile.__iter__cCs|j�}|dkrt�|S)Nr)r"�
StopIteration)rr!rrr�__next__�szBufferedSubFile.__next__N)
�__name__�
__module__�__qualname__rrrrr"r#r+rr.r0rrrrr
-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
�j|_d|_
d|_d|_dS)NFr)�Message)r4T)r4�_old_style_factoryZmessage_factoryZ
email.messager5�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr0�_parse�_cur�_last�_headersonly)rr7r4r5rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)r?)rrrr�_set_headersonly�szFeedParser._set_headersonlycCs|jj|�|j�dS)N)r9r+�_call_parse)rr)rrr�feed�szFeedParser.feedcCs&y|j�Wntk
r YnXdS)N)r<r/)rrrrrA�szFeedParser._call_parsecCsJ|jj�|j�|j�}|j�dkrF|j�rFtj�}|jj	||�|S)N�	multipart)
r9rrA�_pop_message�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr4�
handle_defect)r�root�defectrrrr�s

zFeedParser.closecCsn|jr|j�}n|j|jd�}|jr<|jj�dkr<|jd�|jrR|jdj|�|jj|�||_||_	dS)N)r4zmultipart/digestzmessage/rfc822r%r&)
r6r7r4r=�get_content_typeZset_default_typer:Zattachrr>)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|jj�}|jr|jd|_nd|_|S)Nr%r&)r:rr=)r�retvalrrrrD�s

zFeedParser._pop_messageccs6|j�g}xb|jD]X}|tkr(tVqtj|�sbtj|�s`tj�}|jj	|j
|�|jj|�P|j|�qW|j
|�|jr�g}x2|jj�}|tkr�tVq�|dkr�P|j|�q�W|j
jtj|��dS|j
j�dk�r�x�|jjtj�x$|j�D]}|tk�rtVq�Pq�W|j�}|jj�x&|jj�}|tk�rFtV�q(P�q(Wx&|jj�}|tk�rntV�qPP�qPW|dk�r�P|jj|�q�WdS|j
j�dk�r�x(|j�D]}|tk�r�tV�q�P�q�W|j�dS|j
j�dk�r�|j
j�}|dk�rbtj�}|jj	|j
|�g}x.|jD]$}|tk�r<tV�q$|j|��q$W|j
jtj|��dS|j
jdd�j�dk�r�tj�}|jj	|j
|�d	|}tjd
tj |�d�}	d}
g}d
}d
}
�x|jj�}|tk�r�tV�q�|dk�r�P|	j|�}|�r�|j!d��rd}
|j!d�}P|
�r~|�rj|d}t"j#|�}|�r\|dt$|j!d���|d<tj|�|j
_%d
}
|jj|��q�xB|jj�}|tk�r�tV�q�|	j|�}|�s�|jj|�P�q�W|jj|	j�x(|j�D]}|tk�r�tV�q�P�q�W|j&j�dk�rb|j&j'}|dk�r&d|j&_'n:|dk	�r�t"j#|�}|�r�t$|j!d��}|d|�|j&_'nD|j&j(}t)|t*��r�t"j#|�}|�r�|dt$|j!d���}||j&_(|jj�|j�|j
|_&n
|j|��q�W|
�r>tj+�}|jj	|j
|�|j
jtj|��g}x$|jD]}|tk�rtV�q�qWtj|�|j
_'dS|
�s`tj,�}|jj	|j
|�dS|�rndg}ng}x.|jD]$}|tk�r�tV�qz|j|��qzW|�r�|d}t-j|�}|�r�|t$|j!d��d�|d<tj|�|j
_'dSg}x.|jD]$}|tk�rtV�q�|j|��q�W|j
jtj|��dS)Nrzmessage/delivery-status�messagerCzcontent-transfer-encoding�8bit�7bit�binaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr%r)rOrNrPr&r&).rKr9r�headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr4rFr=r#r�_parse_headersr?r"Zset_payload�EMPTYSTRING�joinrIrr;rDrrEZget_boundaryZNoBoundaryInMultipartDefect�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preambler>�epilogueZ_payload�
isinstance�strZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr!rHr-rLrJ�boundaryZ	separatorZ
boundaryreZcapturing_preamblerbrRZclose_boundary_seen�moZlastlineZeolmorcrQZpayload�	firstlineZbolmorrrr;�sf




































zFeedParser._parsegenc	Cs^d}g}�x4t|�D�]&\}}|ddkrV|sJtj|�}|jj|j|�q|j|�q|rx|jj|jj|��dg}}|j	d��r�|dkr�t
j|�}|r�|dt|j
d���}|jj|�qn:|t|�dkr�|jj|�dStj|�}|jjj|�q|jd�}|dk�r*tjd�}|jjj|�q|d|�}|g}qW|�rZ|jj|jj|��dS)Nrrz 	zFrom r%�:zMissing header name.)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr4rFr=rZset_rawZheader_source_parse�
startswithr_r`rar^Zset_unixfromr9r#ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefect)	rr-Z
lastheaderZ	lastvalue�linenor!rHrh�irrrrV�sF








zFeedParser._parse_headers)N)
r1r2r3rrr@rBrArrKrDr;rVrrrrr�s

~cseZdZ�fdd�Z�ZS)rcst�j|jdd��dS)N�ascii�surrogateescape)�superrB�decode)rr))�	__class__rrrBszBytesFeedParser.feed)r1r2r3rB�
__classcell__rr)rtrrs)�__all__r[ZemailrZemail._policybaser�collectionsr�iorr\rUrfr_ZNLCRE_crackrSrW�NL�objectrr
rrrrrr�<module>s&




[

Zerion Mini Shell 1.0