AlkantarClanX12

Your IP : 18.226.222.76


Current Path : /opt/alt/python39/lib64/python3.9/email/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/email/__pycache__/contentmanager.cpython-39.opt-1.pyc

a

R�f;)�@s.ddlZddlZddlZddlZddlmZGdd�d�Ze�Zd%dd�Ze�	de�d	d
�Z
d��D]Ze�	ee
�qfdd
�Z
d��D]Ze�	dee
�q�dd�Ze�	de�dd�Zdd�Zdd�Zdd�Zd&dd�Ze�ee�d'd d!�Ze�ejje�d(d#d$�ZeeefD]Ze�ee��qdS))�N)�
quoprimimec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ContentManagercCsi|_i|_dS�N)�get_handlers�set_handlers)�self�r�9/opt/alt/python39/lib64/python3.9/email/contentmanager.py�__init__	szContentManager.__init__cCs||j|<dSr)r)r�key�handlerrrr	�add_get_handler
szContentManager.add_get_handlercOs�|��}||jvr.|j||g|�Ri|��S|��}||jvr\|j||g|�Ri|��Sd|jvr�|jd|g|�Ri|��St|��dS)N�)Zget_content_typer�get_content_maintype�KeyError)r�msg�args�kwZcontent_type�maintyperrr	�get_contents


zContentManager.get_contentcCs||j|<dSr)r)rZtypekeyrrrr	�add_set_handlerszContentManager.add_set_handlercOsD|��dkrtd��|�||�}|��|||g|�Ri|��dS)NZ	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handlerZ
clear_content)rr�objrrrrrr	�set_contents
zContentManager.set_contentc	Cs�d}t|�jD]�}||jvr*|j|S|j}t|dd�}|rNd�||f�n|}|dur^|}||jvrv|j|S||jvr�|j|S|j}||jvr|j|Sqd|jvr�|jdSt|��dS)N�
__module__r�.)�type�__mro__r�__qualname__�getattr�join�__name__r)	rrrZfull_path_for_error�typZqname�modname�	full_path�namerrr	r's&





z ContentManager._find_set_handlerN)	r"rrr
r
rrrrrrrr	rs	r�replacecCs&|jdd�}|�dd�}|j||d�S)NT��decode�charset�ASCII)�errors)�get_payloadZ	get_paramr))rr,Zcontentr*rrr	�get_text_content@sr.�textcCs|jdd�S)NTr(�r-�rrrr	�get_non_text_contentGsr2zaudio image video applicationcCs
|�d�S�Nrr0r1rrr	�get_message_contentMsr4zrfc822 external-bodyzmessage/cCst|�d��Sr3)�bytesr-r1rrr	�%get_and_fixup_unknown_message_contentSsr6�messagec
s�d�||f�|d<|r�t|dd�s<|j��fdd�|D�}z(|D]}|jrV|jd�|||j<qBWnBtjjy�}z&td�	|j
|jd���|�WYd}~n
d}~00dS)	N�/zContent-Typerr&csg|]}�j��|g���qSr)Zheader_factoryZheader_source_parse)�.0�header�Zmprr	�
<listcomp>ds�z _prepare_set.<locals>.<listcomp>zInvalid header: {})�policy)r!�hasattrr=Zdefectsr&�emailr,ZHeaderDefect�
ValueError�formatZfold)rr�subtype�headersr:�excrr;r	�_prepare_set_s$
�
��rEcCsx|dur|durd}|dur$||d<|dur>|jd|ddd�|durN||d<|durt|��D]\}}|�||�q^dS)NZ
attachmentzContent-Disposition�filenameT)r:r'z
Content-ID)�	set_param�items)r�dispositionrF�cid�paramsr�valuerrr	�
_finalize_setps�rMcCsVg}|dd}tdt|�|�D]*}||||�}|�t�|��d��q d�|�S)N��r�asciir)�range�len�append�binascii�
b2a_base64r)r!)�data�max_line_lengthZ
encoded_linesZunencoded_bytes_per_line�iZthislinerrr	�_encode_base64�srYcs�|�|���}|j�d���fdd�}dd�}|dur�tdd�|D�dd	�|jkr�zd
||��d�fWStyxYn0|jdkr�d||��dd�fS||dd
��}t�	|�d�|j�}t
�|�}	t|�t|	�kr�d}nd}t|�d
kr�||fS|d
k�r||��d�}
nj|dk�r*||��dd�}
nN|dk�rNt�	||��d�|j�}
n*|dk�rjt
||�|j�}
ntd�|���||
fS)NrPcs��|��Sr�r!��lines��lineseprr	�
embedded_body��z#_encode_text.<locals>.embedded_bodycSsd�|�dS)N�
rZr[rrr	�normal_body�r`z!_encode_text.<locals>.normal_bodycss|]}t|�VqdSr)rR)r9�xrrr	�	<genexpr>�r`z_encode_text.<locals>.<genexpr>r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr^�maxrWr)�UnicodeDecodeErrorZcte_typerZbody_encoderTrUrRrYr@rA)�stringr*�cter=r\r_rbZsniffZsniff_qpZsniff_base64rVrr]r	�_encode_text�sD
�



�
rr�plain�utf-8c
Csdt|d||	�t||||j�\}}
|�|
�|jdtjj�||�dd�||d<t	|||||�dS)Nr/r*T)r'�Content-Transfer-Encoding)
rErrr=�set_payloadrGr?r*ZALIASES�getrM)rrprBr*rqrIrFrJrKrCZpayloadrrr	�set_text_content�s
�rx�rfc822c		Cs�|dkrtd��|dkr@|dvr.td�|���|dur:dn|}n0|dkrd|dvr^td	�|���d
}n|durpd
}t|d||�|�|g�||d<t|||||�dS)
N�partialz4message/partial is not supported for Message objectsry)Nrfrg�binaryz*message/rfc822 parts do not support cte={}rgz
external-body)Nrfz1message/external-body parts do not support cte={}rfr7ru)r@rArErvrM)	rr7rBrqrIrFrJrKrCrrr	�set_message_content�s(��r|rjc

Cs�t||||	�|dkr(t||jjd�}nN|dkrNtj|dddd�}|�d�}n(|dkrb|�d�}n|d	vrv|�dd
�}|�|�||d<t|||||�dS)Nrj)rWrkFT)�istextr:Z	quotetabsrPrf)rgr{rhru)	rErYr=rWrTZb2a_qpr)rvrM)
rrVrrBrqrIrFrJrKrCrrr	�set_bytes_content�s
r~)r')rsrtNNNNNN)ryNNNNNN)rjNNNNN)rTZ
email.charsetr?Z
email.messageZemail.errorsrrZraw_data_managerr.r
r2�splitrr4rBr6rErMrYrrrxr�strr|r7ZMessager~r5�	bytearray�
memoryviewr#rrrr	�<module>sL6
�	'�
�
�