Your IP : 3.14.254.103


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

3


 \F!�@s�ddlZddlZddlZddlZddlmZmZddlmZdddddd	d
dgZ	ej
ejd�jd
d��Z
dd�ZGdd�de�Ze�Zdeed�<dd�Zdd�Zdd�Zdd�Zdd	�Zeed�Zdd
�Zeed�Zeed�Zddd�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�,/usr/lib64/python3.6/email/_encoded_words.py�<lambda>AsrcCs|jdd�}t|�gfS)N�_� )�replace�_q_byte_subber)�encodedrrrrCsc@s,eZdZdejd�ejd�Zdd�ZdS)�	_QByteMaps-!*+/�asciicCs.||jkrt|�||<ndj|�||<||S)Nz={:02X})�safe�chr�format)�self�keyrrr�__missing__Ms
z_QByteMap.__missing__N)�__name__�
__module__�__qualname__rrrrr"rrrrrIsr�_� 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	\scCs�t|�d}|r ddd|�nd}y$tj||dd�|rDtj�gngfStjk
r�ytj|dd�tj�gfStjk
r�y"tj|ddd�tj�tj�gfStjk
r�|tj�gfSXYnXYnXdS)N�s===�T)ZvalidateFs==)	r/�base64Z	b64decoderZInvalidBase64PaddingDefect�binascii�ErrorZInvalidBase64CharactersDefectZInvalidBase64LengthDefect)rZpad_errZmissing_paddingrrrrds cCstj|�jd�S)Nr)r3Z	b64encoder)r.rrrr�scCs&tt|�d�\}}|d|r dndS)N�r1r)�divmodr/)r.Zgroups_of_3Zleftoverrrrr
�s)�q�bc	Cs�|jd�\}}}}}|jd�\}}}|j�}|jdd�}t||�\}}y|j|�}Wnvtk
r�|jtj	dj
|���|j|d�}YnBtk
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�UnicodeError�appendrZUndecodableBytesDefectr�LookupErrorZCharsetError)	Zewr&�charsetZcteZ
cte_string�langr.Zdefects�stringrrrr�s"
�utf-8r(cCs||dkr|jdd�}n
|j|�}|dkrTtd|�}td|�}||dkrPdnd}t||�}|rld|}dj||||�S)	Nzunknown-8bitrr<r8r9�r;z=?{}{}?{}?{}?=)r�_cte_encode_length�
_cte_encodersr)rFrD�encodingrEr.ZqlenZblenrrrrr�s
)rGNr()�rer3r4�	functoolsrFrrZemailr�__all__�partial�compile�subrr�dictrr)�ordrr	rrr
r@rrJrIrrrrr�<module>*s@
&+

?>