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__/header.cpython-37.opt-2.pyc

B

YI~d&^�@s�dddgZddlZddlZddlZddlZddlmZddlmZ	e	j
Z
dZdZd	Z
d
ZdZdZd
Ze
d�Ze
d�Ze�dejejB�Ze�d�Ze�d�ZejjZdd�Zddd�ZGdd�d�ZGdd�d�ZGdd�de �Z!dS)�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � z        ��Nz 	zus-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # 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�St�|�s.|dfgSg}x�|��D]�}t�|�}d}xp|r�|�d�}|rn|��}d}|r�|�|ddf�|rP|�d��	�}|�d��	�}|�d�}|�|||f�qPWq<Wg}	xVt
|�D]J\}
}|
dkr�|dr�||
ddr�||
dd��r�|	�|
d�q�Wxt|	�D]}||=�q*Wg}
x�|D]�\}}}|dk�rh|
�||f�n�|d	k�r�t
j�|�}|
�||f�n~|d
k�rt|�d}|�r�|ddd|�7}yt
j�|�}Wn tjk
�r�td
��YnX|
�||f�ntd|���qDWg}d}}x~|
D]v\}}t|t��rBt|d�}|dk�rV|}|}nB||k�rx|�||f�|}|}n |dk�r�|t|7}n||7}�q$W|�||f�|S)N�_chunkscSs(g|] \}}t�|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrr
r
�1/opt/alt/python37/lib64/python3.7/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_charsetr
r
rr=sz






4






cCsJt|||d�}x6|D].\}}|dk	r6t|t�s6t|�}|�||�qW|S)N)�
maxlinelen�header_name�continuation_ws)rr,�Charsetr )Zdecoded_seqr8r9r:�h�srr
r
rr�sc@sJeZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�Zddd�Zdd�Z	dS)rNr�strictcCs||dkrt}nt|t�s t|�}||_||_g|_|dk	rH|�|||�|dkrTt}||_|dkrjd|_	nt
|�d|_	dS)Nrr)�USASCIIr,r;r�_continuation_wsrr �
MAXLINELEN�_maxlinelen�
_headerlenr')�selfr=rr8r9r:�errorsr
r
r�__init__�s
zHeader.__init__c	Cs�|��g}d}d}x�|jD]�\}}|}|tjkrJ|�dd�}|�dd�}|r�|o^|�|d�}|dkr�|dkr�|s�|�t�d}n|dkr�|s�|�t�|o�|�|d�}|}|�|�qWt	�
|�S)N�ascii�surrogateescape�replacer)Nzus-ascii���)�
_normalizerr�UNKNOWN8BIT�encoder(�	_nonctextr �SPACE�EMPTYSTRING�join)	rDZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacer
r
r�__str__�s*


zHeader.__str__cCs|t|�kS)N)r)rD�otherr
r
r�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s"t|�}t|t�sZ|jp4d}|tjkrN|�dd�}n|�||�}|jpbd}|tjkr�y|�||�Wn"t	k
r�|dkr��t
}YnX|j�||f�dS)Nzus-asciirH)
rr,r;rZinput_codecrLr(Zoutput_codecrM�UnicodeEncodeError�UTF8rr )rDr=rrEZ
input_charset�output_charsetr
r
rr 	s$






z
Header.appendcCs|��p|dkS)N)�(�)�\)r#)rDr=r
r
rrN4szHeader._nonctext�;, 	rcCs�|��|dkr|j}|dkr"d}t|j||j|�}d}d}}�x.|jD�]"\}}	|dk	r�|ol|�|d�}|dkr�|r�|	dkr�|��n|	dkr�|s�|��|o�|�|d�}|	}d}|��}
|
r�|�	d|
d|	�n|�	dd|	�xp|
dd�D]`}|�
�|	jdk	�r(|�	|jd|��|	�q�|��}|dt
|�t
|��}
|�	|
||	�q�Wt
|
�dkrJ|�
�qJW|j�r�|��|�|�}t�|��r�td	�|���|S)
Nri@B)Nzus-asciirJFr
rrz8header value appears to contain an embedded header: {!r})rKrB�_ValueFormatterrCr@rrN�add_transitionr�feed�newline�header_encodingrr'�_str�_embedded_headerrr�format)rD�
splitcharsr8�linesep�	formatterrRrTrSrr�linesr0Zsline�fws�valuer
r
rrM9sR!


z
Header.encodecCs|g}d}g}xL|jD]B\}}||kr0|�|�q|dk	rL|�t�|�|f�|g}|}qW|rr|�t�|�|f�||_dS)N)rr rOrQ)rDZchunksr7Z
last_chunkrrr
r
rrK�szHeader._normalize)NNNNrr>)Nr>)r^Nr)
�__name__�
__module__�__qualname__rFrUrWr rNrMrKr
r
r
rr�s
- 
+
Pc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)r_cCs0||_||_t|�|_||_g|_t|�|_dS)N)�_maxlenr@r'�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rDZ	headerlen�maxlenr:rgr
r
rrF�s
z_ValueFormatter.__init__cCs|��|�|j�S)N)rbrQrs)rDrhr
r
rrd�sz_ValueFormatter._strcCs
|�t�S)N)rd�NL)rDr
r
rrU�sz_ValueFormatter.__str__cCsv|j��}|dkr|jj|�t|j�dkrh|j��rV|jrV|jdt|j�7<n|j�t|j��|j��dS)N)rr
rrJ)	rur�pushr'�	is_onlywsrsrr �reset)rDZend_of_liner
r
rrb�s
z_ValueFormatter.newlinecCs|j�dd�dS)Nrr
)rurx)rDr
r
rr`�sz_ValueFormatter.add_transitioncCs�|jdkr|�|||j�dS|�||���}y|�d�}Wntk
rPdSX|dk	rf|�||�y|��}Wntk
r�dSX|��|j	�
|j|�x|D]}|j�
|j|�q�WdS)Nr)rc�_ascii_splitrrZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrbrurxr@rsr )rDrkrrZ
encoded_linesZ
first_line�	last_liner0r
r
rra�s$

z_ValueFormatter.feedccs*|jt|j�Vx|j|jVqWdS)N)rpr'rurq)rDr
r
rr|�sz_ValueFormatter._maxlengthscCsjt�dtd||�}|dr0dg|dd�<n
|�d�x*tt|�gd�D]\}}|�||�qNWdS)Nz([z]+)rr
r)�rer�FWSr�zip�iterr~)rDrkrrgr1�partr
r
rr{�s
z_ValueFormatter._ascii_splitcCs
|j�||�t|j�|jk�rx�|jD]t}xlt|j��ddd�D]P}|��rp|j|d}|rp|d|krpP|j|dd}|rD|d|krDPqDWq(Pq(W|j��\}}|jj	dkr�|�
�|s�d}|j�||�dS|j�|�}|j�
t|j��|j�|�dS)NrrrJr)rurxr'rprr�range�
part_countr#r�
_initial_sizerb�pop_fromrsr rrz)rDrkrZch�iZprevpartr�Z	remainderr
r
rr~�s.z_ValueFormatter._append_chunkN)rmrnrorFrdrUrbr`rar|r{r~r
r
r
rr_�s%r_csjeZdZd�fdd�	Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�ZS)rtrcs||_t���dS)N)r��superrF)rDZinitial_size)�	__class__r
rrFsz_Accumulator.__init__cCs|�||f�dS)N)r )rDrkrr
r
rrx#sz_Accumulator.pushcCs||d�}g||d�<|S)Nr
)rDr�Zpoppedr
r
rr�&sz_Accumulator.pop_fromcs|��dkrdSt���S)Nr)r
r
)r�r�r)rD)r�r
rr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss"|]\}}t|�t|�VqdS)N)r')rrkr�r
r
r�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�)rDr
r
r�__len__0sz_Accumulator.__len__cCst�dd�|D��S)Ncss |]\}}t�||f�VqdS)N)rPrQ)rrkr�r
r
rr�5sz'_Accumulator.__str__.<locals>.<genexpr>)rPrQ)rDr
r
rrU4s
z_Accumulator.__str__NcCs"|dkrg}||dd�<d|_dS)Nr)r�)rDZstartvalr
r
rrz8sz_Accumulator.resetcCs|jdko|pt|���S)Nr)r�rr#)rDr
r
rry>sz_Accumulator.is_onlywscs
t���S)N)r�r�)rD)r�r
rr�Asz_Accumulator.part_count)r)r)N)
rmrnrorFrxr�rr�rUrzryr��
__classcell__r
r
)r�rrts

rt)NNr)"�__all__r�r)Zemail.quoprimimer%Zemail.base64mimeZemail.errorsrrrr;rwrOr.ZSPACE8rPrAr�r?rY�compile�VERBOSE�	MULTILINErZfcrerer&Z_max_appendrrrr_�listrtr
r
r
r�<module>s>

_
k

Hacked By AnonymousFox1.0, Coded By AnonymousFox