Your IP : 18.217.10.152


Current Path : /opt/alt/python35/lib64/python3.5/email/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/email/__pycache__/_encoded_words.cpython-35.opt-2.pyc



���]��@sjddlZddlZddlZddlZddlmZmZddlmZdddddd	d
dgZ	ej
ejd�jd
d��Z
dd�ZGdd�de�Ze�Zdeed�<dd�Zdd�Zdd�Zdd�Zdd	�ZdedeiZdd
�ZdedeiZdedeiZddddd�ZdS)�N)�
ascii_letters�digits)�errors�decode_q�encode_q�decode_b�encode_b�len_q�len_b�decode�encodes=([a-fA-F0-9]{2})cCstt|jd�d�g�S)N��)�bytes�int�group)�m�r�3/opt/alt/python35/lib64/python3.5/_encoded_words.py�<lambda>AsrcCs"|jdd�}t|�gfS)N�_� )�replace�_q_byte_subber)�encodedrrrrCsc@s<eZdZdejd�ejd�Zdd�ZdS)�	_QByteMaps-!*+/�asciicCs=||jkr"t|�||<ndj|�||<||S)Nz={:02X})�safe�chr�format)�self�keyrrr�__missing__Msz_QByteMap.__missing__N)�__name__�
__module__�__qualname__rrrrr"rrrrrIs r�_� cCsdjdd�|D��S)N�css|]}t|VqdS)N)�_q_byte_map)�.0�xrrr�	<genexpr>Zszencode_q.<locals>.<genexpr>)�join)�bstringrrrrYscCstdd�|D��S)Ncss|]}tt|�VqdS)N)�lenr))r*r+rrrr,]szlen_q.<locals>.<genexpr>)�sum)r.rrrr	\scCsg}t|�d}|rJ|jtj��|ddd|�}n|}ytj|dd�|fSWn�tjk
rtj�g}xvdD]b}y%tj|d	|dd
�|fSWq�tjk
r�|dkr�|jtj��Yq�Xq�Wt	d��YnXdS)
N�s===ZvalidateTrr
���=Fzunexpected binascii.Error)rr
r2r3)
r/�appendrZInvalidBase64PaddingDefect�base64Z	b64decode�binascii�ErrorZInvalidBase64CharactersDefect�AssertionError)r�defectsZpad_errZpadded_encoded�irrrrds"
%cCstj|�jd�S)Nr)r6Z	b64encoder)r.rrrr~scCs3tt|�d�\}}|d|r.dndS)Nr3r1r)�divmodr/)r.Zgroups_of_3Zleftoverrrrr
�s�q�bc	Cs'|jd�\}}}}}|jd�\}}}|j�}|jdd�}t||�\}}y|j|�}Wn�tk
r�|jtj	dj
|���|j|d�}YnUtk
r|jdd�}|j�dkr|jtjdj
|���YnX||||fS)N�?�*r�surrogateescapez:Encoded word contains bytes not decodable using {} charsetzunknown-8bitz<Unknown charset {} in encoded word; decoded as unknown bytes)
�split�	partition�lowerr�
_cte_decodersr�UnicodeErrorr5rZUndecodableBytesDefectr�LookupErrorZCharsetError)	Zewr&�charsetZcteZ
cte_string�langr.r:�stringrrrr�s"


zutf-8r(cCs�|dkr!|jdd�}n|j|�}|dkrxtd|�}td|�}||dkrrdnd}t||�}|r�d|}dj||||�S)	Nzunknown-8bitrrAr=r>�r@z=?{}{}?{}?{}?=)r�_cte_encode_length�
_cte_encodersr)rJrH�encodingrIr.ZqlenZblenrrrrr�s
)�rer6r7�	functoolsrJrrZemailr�__all__�partial�compile�subrr�dictrr)�ordrr	rrr
rErrMrLrrrrr�<module>*s@		+

?>