Mini Shell

Direktori : /lib64/python3.9/email/__pycache__/
Upload File :
Current File : //lib64/python3.9/email/__pycache__/contentmanager.cpython-39.pyc

a

�DOg;)�@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�,/usr/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��mprr	�
<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$
�
��rFcCsx|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�dispositionrG�cid�paramsr�valuerrr	�
_finalize_setps�rNcCsVg}|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rZcs�|�|���}|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)NrQcs��|��Sr�r!��lines��lineseprr	�
embedded_body��z#_encode_text.<locals>.embedded_bodycSsd�|�dS)N�
r[r\rrr	�normal_body�raz!_encode_text.<locals>.normal_bodycss|]}t|�VqdSr)rS)r9�xrrr	�	<genexpr>�raz_encode_text.<locals>.<genexpr>r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr_�maxrXr)�UnicodeDecodeErrorZcte_typerZbody_encoderUrVrSrZrArB)�stringr*�cter>r]r`rcZsniffZsniff_qpZsniff_base64rWrr^r	�_encode_text�sD
�



�
rs�plain�utf-8c
Csdt|d||	�t||||j�\}}
|�|
�|jdtjj�||�dd�||d<t	|||||�dS)Nr/r*T)r'�Content-Transfer-Encoding)
rFrsr>�set_payloadrHr@r*ZALIASES�getrN)rrqrCr*rrrJrGrKrLrD�payloadrrr	�set_text_content�s
�rz�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 objectsr{)Nrgrh�binaryz*message/rfc822 parts do not support cte={}rhz
external-body)Nrgz1message/external-body parts do not support cte={}rgr7rv)rArBrFrwrN)	rr7rCrrrJrGrKrLrDrrr	�set_message_content�s(��r~rkc

Cs�t||||	�|dkr(t||jjd�}nN|dkrNtj|dddd�}|�d�}n(|dkrb|�d�}n|d	vrv|�dd
�}|�|�||d<t|||||�dS)Nrk)rXrlFT)�istextr:Z	quotetabsrQrg)rhr}rirv)	rFrZr>rXrUZb2a_qpr)rwrN)
rrWrrCrrrJrGrKrLrDrrr	�set_bytes_content�s
r�)r')rtruNNNNNN)r{NNNNNN)rkNNNNN)rUZ
email.charsetr@Z
email.messageZemail.errorsrrZraw_data_managerr.r
r2�splitrr4rCr6rFrNrZrsrzr�strr~r7ZMessager�r5�	bytearray�
memoryviewr#rrrr	�<module>sL6
�	'�
�
�


Zerion Mini Shell 1.0