ok

Mini Shell

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

3


 \&^�@s�dddgZddlZddlZddlZddlZddlmZddlmZ	e	j
Z
dZdZd	Z
dZdZdZd
Ze
d�Ze
d�ZejdejejBejB�Zejd�Zejd�ZejjZdd�Zddd�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�rdd�|jD�Stj|�s.|dfgSg}x�|j�D]�}tj|�}d}xp|r�|jd�}|rn|j�}d}|r�|j|ddf�|rP|jd�j	�}|jd�j	�}|jd�}|j|||f�qPWq<Wg}	xVt
|�D]J\}
}|
dkr�|dr�||
ddr�||
ddj�r�|	j|
d�q�Wxt|	�D]}||=�q*Wg}
x�|D]�\}}}|dk�rh|
j||f�n�|d	k�r�t
jj|�}|
j||f�n~|d
k�rt|�d}|�r�|ddd|�7}yt
jj|�}Wn tjk
�r�td
��YnX|
j||f�ntd|���qDWg}d}}x~|
D]v\}}t|t��rBt|d�}|dk�rV|}|}nB||k�rx|j||f�|}|}n |dk�r�|t|7}n||7}�q$W|j||f�|S)N�_chunkscSs(g|] \}}tj|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrrr�$/usr/lib64/python3.6/email/header.py�
<listcomp>Msz!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�encodingZencodedZdroplist�n�w�dZ
decoded_wordsZencoded_stringZwordZpaderrZ	collapsedZ	last_word�last_charsetrrrr=sz






4






cCsLt|||d�}x8|D]0\}}|dk	r8t|t�r8t|�}|j||�qW|S)N)�
maxlinelen�header_name�continuation_ws)rr-�Charsetr!)Zdecoded_seqr9r:r;�h�srrrrr�sc@sJeZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�Zddd�Zdd�Z	dS)rNr�strictcCs||dkrt}nt|t�s t|�}||_||_g|_|dk	rH|j|||�|dkrTt}||_|dkrjd|_	nt
|�d|_	dS)Nrr)�USASCIIr-r<r�_continuation_wsr
r!�
MAXLINELEN�_maxlinelen�
_headerlenr()�selfr>rr9r:r;�errorsrrr�__init__�s
zHeader.__init__c	Cs�|j�g}d}d}x�|jD]�\}}|}|tjkrJ|jdd�}|jdd�}|r�|o^|j|d�}|dkr�|dkr�|r�|jt�d}n|d	kr�|r�|jt�|o�|j|d
�}|}|j|�qWt	j
|�S)N�ascii�surrogateescape�replacer�us-asciir)NrK)NrK)NrK���)�
_normalizer
r�UNKNOWN8BIT�encoder)�	_nonctextr!�SPACE�EMPTYSTRING�join)	rEZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacerrr�__str__�s*


zHeader.__str__cCs|t|�kS)N)r)rE�otherrrr�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s"t|�}t|t�sZ|jp4d}|tjkrN|jdd�}n|j||�}|jpbd}|tjkr�y|j||�Wn"t	k
r�|dkr��t
}YnX|jj||f�dS)Nzus-asciirI)
rr-r<rZinput_codecrNr)Zoutput_codecrO�UnicodeEncodeError�UTF8r
r!)rEr>rrFZ
input_charsetZoutput_charsetrrrr!	s$






z
Header.appendcCs|j�p|dkS)N�(�)�\)r\r]r^)r$)rEr>rrrrP4szHeader._nonctext�;, 	rcCs�|j�|dkr|j}|dkr"d}t|j||j|�}d}d}}�x4|jD�](\}}	|dk	r�|ol|j|d�}|d	kr�|s�|	d
kr�|j�n|	dkr�|r�|j�|o�|j|d�}|	}d}|j�}
|
r�|j	d|
d|	�n|j	dd|	�xr|
dd�D]b}|j
�|	jdk	�r,|j	|jd|j�|	�n.|j�}|dt
|�t
|��}
|j	|
||	��q�Wt
|
�dkrJ|j
�qJW|j�r�|j�|j|�}tj|��r�tdj|���|S)
Nri@B�us-asciirFrrz8header value appears to contain an embedded header: {!r})Nr`)Nr`)Nr`rL)rMrC�_ValueFormatterrDrAr
rP�add_transitionr�feed�newline�header_encodingr r(�_str�_embedded_headerrr�format)rE�
splitcharsr9�linesepZ	formatterrTrVrUrr�linesr1Zsline�fws�valuerrrrO9sR!


z
Header.encodecCs|g}d}g}xL|jD]B\}}||kr0|j|�q|dk	rL|jtj|�|f�|g}|}qW|rr|jtj|�|f�||_dS)N)r
r!rQrS)rEZchunksr8Z
last_chunkrrrrrrM�szHeader._normalize)NNNNrr?)Nr?)r_Nr)
�__name__�
__module__�__qualname__rGrWrYr!rPrOrMrrrrr�s
- 
+
Pc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)racCs0||_||_t|�|_||_g|_t|�|_dS)N)�_maxlenrAr(�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rEZ	headerlen�maxlenr;rirrrrG�s
z_ValueFormatter.__init__cCs|j�|j|j�S)N)rdrSrt)rErjrrrrf�sz_ValueFormatter._strcCs
|jt�S)N)rf�NL)rErrrrW�sz_ValueFormatter.__str__cCsp|jj�}|dkr|jj|�t|j�dkrb|jj�rP|jdt|j�7<n|jjt|j��|jj�dS)Nrrrr)rrrL)	rvr�pushr(�	is_onlywsrtrr!�reset)rEZend_of_linerrrrd�s

z_ValueFormatter.newlinecCs|jjdd�dS)Nrr)rvry)rErrrrb�sz_ValueFormatter.add_transitioncCs�|jdkr|j|||j�dS|j||j��}y|jd�}Wntk
rPdSX|dk	rf|j||�y|j�}Wntk
r�dSX|j�|j	j
|j|�x|D]}|jj
|j|�q�WdS)Nr)re�_ascii_splitrsZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrdrvryrArtr!)rErlrrZ
encoded_linesZ
first_line�	last_liner1rrrrc�s$

z_ValueFormatter.feedccs*|jt|j�Vx|j|jVqWdS)N)rqr(rvrr)rErrrr}�sz_ValueFormatter._maxlengthscCsjtjdtd||�}|dr0dg|dd�<n
|jd�x*tt|�gd�D]\}}|j||�qNWdS)Nz([z]+)rrr)�rer�FWSr�zip�iterr)rErlrrir2�partrrrr|�s
z_ValueFormatter._ascii_splitcCs
|jj||�t|j�|jk�rx�|jD]t}xlt|jj�ddd�D]P}|j�rp|j|d}|rp|d|krpP|j|dd}|rD|d|krDPqDWq(Pq(W|jj�\}}|jj	dkr�|j
�|s�d}|jj||�dS|jj|�}|jj
t|j��|jj|�dS)NrrrrLrL)rvryr(rqrs�range�
part_countr$r�
_initial_sizerd�pop_fromrtr!rr{)rErlrZch�iZprevpartr�Z	remainderrrrr�s.z_ValueFormatter._append_chunkN)rnrorprGrfrWrdrbrcr}r|rrrrrra�s%racsjeZdZd�fdd�	Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�ZS)rurcs||_t�j�dS)N)r��superrG)rEZinitial_size)�	__class__rrrGsz_Accumulator.__init__cCs|j||f�dS)N)r!)rErlrrrrry#sz_Accumulator.pushcCs||d�}g||d�<|S)Nr)rEr�Zpoppedrrrr�&sz_Accumulator.pop_fromcs|j�dkrdSt�j�S)Nrr)rr)r�r�r)rE)r�rrr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss"|]\}}t|�t|�VqdS)N)r()rrlr�rrr�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�)rErrr�__len__0sz_Accumulator.__len__cCstjdd�|D��S)Ncss |]\}}tj||f�VqdS)N)rRrS)rrlr�rrrr�5sz'_Accumulator.__str__.<locals>.<genexpr>)rRrS)rErrrrW4s
z_Accumulator.__str__NcCs"|dkrg}||dd�<d|_dS)Nr)r�)rEZstartvalrrrr{8sz_Accumulator.resetcCs|jdko|pt|�j�S)Nr)r�rr$)rErrrrz>sz_Accumulator.is_onlywscs
t�j�S)N)r�r�)rE)r�rrr�Asz_Accumulator.part_count)r)r)N)
rnrorprGryr�rr�rWr{rzr��
__classcell__rr)r�rrus

ruz        )NNr)#�__all__r�r*Zemail.quoprimimer&Zemail.base64mimeZemail.errorsrrrr<rxrQr/ZSPACE8rRrBr�r@r[�compile�VERBOSE�
IGNORECASE�	MULTILINErZfcrergr'Z_max_appendrrrra�listrurrrr�<module>s>

_
k

Zerion Mini Shell 1.0