ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python35/lib64/python3.5/email/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/email/__pycache__/header.cpython-35.opt-2.pyc



���]$^�@sXdddgZddlZddlZddlZddlZddlmZddlmZ	e	j
Z
dZdZd	Z
dZdZdZd
Ze
d�Ze
d�ZejdejejBejB�Zejd�Zejd�ZejjZdd�Zddddd�ZGdd�d�ZGdd�d�Z Gdd�de!�Z"dS)�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � ���Nz 	zus-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qb])    # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  z[\041-\176]+:$z
\n[^ \t]+:cCs�t|d�r#dd�|jD�Stj|�s?|dfgSg}x�|j�D]�}tj|�}d}x�|r|jd�}|r�|j�}d}|r�|j|ddf�|rp|jd�j	�}|jd�j	�}|jd�}|j|||f�qpWqRWg}	xkt
|�D]]\}
}|
dkr)|dr)||
ddr)||
ddj�r)|	j|
d�q)Wxt|	�D]
}||=q�Wg}
x|D]�\}}}|dkr�|
j||f�q�|d	krt
jj|�}|
j||f�q�|d
kr�t|�d}|rT|ddd|�7}yt
jj|�}Wn!tjk
r�td
��Yq�X|
j||f�q�td|��q�Wg}d}}x�|
D]�\}}t|t�r�t|d�}|dkr|}|}q�||krB|j||f�|}|}q�|dkr_|t|7}q�||7}q�W|j||f�|S)N�_chunkscSs:g|]0\}}tj|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrrr�+/opt/alt/python35/lib64/python3.5/header.py�
<listcomp>Ms	z!decode_header.<locals>.<listcomp>TrF���q�b�z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)�hasattrr
�ecre�search�
splitlines�split�pop�lstrip�append�lower�	enumerate�isspace�reversed�email�
quoprimimeZ
header_decode�lenZ
base64mime�decode�binascii�Errorr�AssertionError�
isinstancer�bytes�BSPACE)�headerZwords�line�parts�firstZ	unencodedr�encoding�encodedZdroplist�n�w�dZ
decoded_wordsZencoded_stringZwordZpaderrZ	collapsedZ	last_word�last_charsetrrrr=sz	
	@
		cCsntd|d|d|�}xL|D]D\}}|dk	rVt|t�rVt|�}|j||�q"W|S)N�
maxlinelen�header_name�continuation_ws)rr-�Charsetr!)Zdecoded_seqr:r;r<�h�srrrrr�s	c@s�eZdZdddddddd�Zdd�Zdd	�Zddd
d�Zdd
�Zddddd�Zdd�Z	dS)rNr�strictcCs�|dkrt}nt|t�s0t|�}||_||_g|_|dk	rj|j|||�|dkr|t}||_|dkr�d|_	nt
|�d|_	dS)Nrr)�USASCIIr-r=r�_continuation_wsr
r!�
MAXLINELEN�_maxlinelen�
_headerlenr()�selfr?rr:r;r<�errorsrrr�__init__�s					zHeader.__init__c	Cs|j�g}d}d}x�|jD]�\}}|}|tjkrk|jdd�}|jdd�}|r�|o�|j|d�}|dkr�|dkr�|r�|jt�d}n |d	kr�|r�|jt�|o�|j|d
�}|}|j|�q&Wt	j
|�S)N�ascii�surrogateescape�replacer�us-asciir)NrL)NrL)NrL���)�
_normalizer
r�UNKNOWN8BIT�encoder)�	_nonctextr!�SPACE�EMPTYSTRING�join)	rFZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacerrr�__str__�s*

	
zHeader.__str__cCs|t|�kS)N)r)rF�otherrrr�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s3t|�}t|t�s�|jpNd}|tjkru|jdd�}n|j||�}|jp�d}|tjkr�y|j||�Wn't	k
r�|dkr��t
}YnX|jj||f�dS)Nzus-asciirJ)
rr-r=rZinput_codecrOr)Zoutput_codecrP�UnicodeEncodeError�UTF8r
r!)rFr?rrGZ
input_charset�output_charsetrrrr!	s$
z
Header.appendcCs|j�p|dkS)N�(�)�\)r^r_r`)r$)rFr?rrrrQ4szHeader._nonctextz;, 	rcCsD|j�|dkr|j}|dkr1d}t|j||j|�}d}d}}x�|jD]�\}}	|dk	r�|o�|j|d�}|d	kr�|s�|	d
kr�|j�n|	dkr�|r�|j�|o�|j|d�}|	}d}|j�}
|
r1|j	d|
d|	�n|j	dd|	�x�|
dd�D]�}|j
�|	jdk	r�|j	|jd|j�|	�qU|j�}|dt
|�t
|��}
|j	|
||	�qUWt
|
�dkrf|j
�qfW|jr
|j�|j|�}tj|�r@tdj|���|S)
Nri@B�us-asciirFrrz8header value appears to contain an embedded header: {!r})Nra)Nra)NrarM)rNrD�_ValueFormatterrErBr
rQ�add_transitionr�feed�newline�header_encodingr r(�_str�_embeded_headerrr�format)rF�
splitcharsr:�linesep�	formatterrUrWrVrr�linesr1Zsline�fws�valuerrrrP9sR!
	




 	
	z
Header.encodecCs�g}d}g}xj|jD]_\}}||krD|j|�q|dk	rl|jtj|�|f�|g}|}qW|r�|jtj|�|f�||_dS)N)r
r!rRrT)rF�chunksr9Z
last_chunkrrrrrrN�s	
zHeader._normalize)
�__name__�
__module__�__qualname__rHrXrZr!rQrPrNrrrrr�s- +Pc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)rbcCsF||_||_t|�|_||_g|_t|�|_dS)N)�_maxlenrBr(�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rFZ	headerlen�maxlenr<rjrrrrH�s				z_ValueFormatter.__init__cCs|j�|j|j�S)N)rerTrw)rFrkrrrrg�s
z_ValueFormatter._strcCs
|jt�S)N)rg�NL)rFrrrrX�sz_ValueFormatter.__str__cCs�|jj�}|dkr+|jj|�t|j�dkr�|jj�rl|jdt|j�7<n|jjt|j��|jj�dS)Nrrrr)rrrM)	ryr�pushr(�	is_onlywsrwrr!�reset)rFZend_of_linerrrre�sz_ValueFormatter.newlinecCs|jjdd�dS)Nrr)ryr|)rFrrrrc�sz_ValueFormatter.add_transitioncCs�|jdkr)|j|||j�dS|j||j��}y|jd�}Wntk
rldSYnX|dk	r�|j||�y|j�}Wntk
r�dSYnX|j�|j	j
|j|�x%|D]}|jj
|j|�q�WdS)Nr)rf�_ascii_splitrvZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkreryr|rBrwr!)rFrnrrZ
encoded_linesZ
first_lineZ	last_liner1rrrrd�s$
	
	

z_ValueFormatter.feedccs/|jt|j�Vx|j|jVqWdS)N)rtr(ryru)rFrrrr��sz_ValueFormatter._maxlengthscCs�tjdtd||�}|dr>dg|dd�<n
|jd�x7tt|�gd�D]\}}|j||�qeWdS)Nz([z]+)rrr)�rer�FWSr�zip�iterr�)rFrnrrjr2�partrrrr�s

&z_ValueFormatter._ascii_splitcCs`|jj||�t|j�|jkr\x�|jD]�}x�t|jj�ddd�D]f}|j�r�|j|d}|r�|d|kr�P|j|dd}|r[|d|kr[Pq[Wq5Pq5W|jj�\}}|jj	dkr
|j
�|s
d}|jj||�dS|jj|�}|jj
t|j��|jj|�dS)NrrrrMrM)ryr|r(rtrv�range�
part_countr$r�
_initial_sizere�pop_fromrwr!rr~)rFrnrZch�iZprevpartr�Z	remainderrrrr��s.&
z_ValueFormatter._append_chunkN)rqrrrsrHrgrXrercrdr�rr�rrrrrb�s%rbcs�eZdZd�fdd�Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�S)rxrcs||_t�j�dS)N)r��superrH)rFZinitial_size)�	__class__rrrHs	z_Accumulator.__init__cCs|j||f�dS)N)r!)rFrnrrrrr|#sz_Accumulator.pushcCs$||d�}g||d�<|S)Nr)rFr�Zpoppedrrrr�&sz_Accumulator.pop_fromcs#|j�dkrdSt�j�S)Nrr)rr)r�r�r)rF)r�rrr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss+|]!\}}t|�t|�VqdS)N)r()rrnr�rrr�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�)rFrrr�__len__0sz_Accumulator.__len__cCstjdd�|D��S)Ncss*|] \}}tj||f�VqdS)N)rSrT)rrnr�rrrr�5sz'_Accumulator.__str__.<locals>.<genexpr>)rSrT)rFrrrrX4sz_Accumulator.__str__NcCs/|dkrg}||dd�<d|_dS)Nr)r�)rFZstartvalrrrr~8sz_Accumulator.resetcCs&|jdko%|p%t|�j�S)Nr)r�rr$)rFrrrr}>sz_Accumulator.is_onlywscs
t�j�S)N)r�r�)rF)r�rrr�Asz_Accumulator.part_count)rqrrrsrHr|r�rr�rXr~r}r�rr)r�rrxsrxz        )#�__all__r�r*Zemail.quoprimimer&Zemail.base64mimeZemail.errorsrrrr=r{rRr/ZSPACE8rSrCr�rAr\�compile�VERBOSE�
IGNORECASE�	MULTILINErZfcrerhr'Z_max_appendrrrrb�listrxrrrr�<module>s:		_��

Zerion Mini Shell 1.0