AlkantarClanX12

Your IP : 3.149.231.122


Current Path : /opt/alt/python312/lib64/python3.12/email/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/email/__pycache__/contentmanager.cpython-312.opt-2.pyc

�

�Q�f\)��F�ddlZddlZddlZddlZddlmZGd�d�Ze�Zdd�Zejde�d�Z
dj�D]Zejee
��[d	�Z
d
j�D]Zejdeze
��[d�Zejd
e�d�Zd�Zd�Zd�Z			dd�Zej+ee�			dd�Zej+ej0j2e�			dd�ZeeefD]Zej+ee��[y)�N)�
quoprimimec�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�ContentManagerc� �i|_i|_y�N)�get_handlers�set_handlers)�selfs �;/opt/alt/python312/lib64/python3.12/email/contentmanager.py�__init__zContentManager.__init__	s��������c�"�||j|<yr)r)r
�key�handlers   r�add_get_handlerzContentManager.add_get_handler
s��!(����#�r
c�B�|j�}||jvr|j||g|��i|��S|j�}||jvr|j||g|��i|��Sd|jvr|jd|g|��i|��St|��)N�)�get_content_typer�get_content_maintype�KeyError)r
�msg�args�kw�content_type�maintypes      r�get_contentzContentManager.get_contents����+�+�-���4�,�,�,�2�4�$�$�\�2�3�D��D��D�D��+�+�-���t�(�(�(�.�4�$�$�X�.�s�@�T�@�R�@�@�
��"�"�"�(�4�$�$�R�(��:�t�:�r�:�:��|�$�$r
c�"�||j|<yr)r	)r
�typekeyrs   r�add_set_handlerzContentManager.add_set_handlers��%,����'�"r
c��|j�dk(rtd��|j||�}|j�|||g|��i|��y)N�	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handler�
clear_content)r
r�objrrrs      r�set_contentzContentManager.set_contentsS���#�#�%��4��@�A�A��(�(��c�2��������S�&�4�&�2�&r
c��d}t|�jD]�}||jvr|j|cS|j}t	|dd�}|rdj||f�n|}|�|}||jvr|j|cS||jvr|j|cS|j}||jvs��|j|cSd|jvr|jdSt|��)N�
__module__r�.)�type�__mro__r	�__qualname__�getattr�join�__name__r)	r
rr%�full_path_for_error�typ�qname�modname�	full_path�names	         rr#z ContentManager._find_set_handler's
��"����9�$�$�C��d�'�'�'��(�(��-�-��$�$�E��c�<��4�G�6=����'�5�!1�2�5�I�"�*�&/�#��D�-�-�-��(�(��3�3���)�)�)��(�(��/�/��<�<�D��t�(�(�(��(�(��.�.�%��4�$�$�$��$�$�T�*�*��*�+�+r
N)	r/r(r,rrrrr&r#�r
rrrs ���)�	%�-�'�,r
rc�p�|jd��}|jdd�}|j||��S)NT��decode�charset�ASCII)�errors)�get_payload�	get_paramr9)rr<�contentr:s    r�get_text_contentr@@s5���o�o�T�o�*�G��m�m�I�w�/�G��>�>�'�&�>�1�1r
�textc�&�|jd��S)NTr8�r=�rs r�get_non_text_contentrEGs���?�?�$�?�'�'r
zaudio image video applicationc�$�|jd�S�NrrCrDs r�get_message_contentrHNs���?�?�1��r
zrfc822 external-bodyzmessage/c�6�t|jd��SrG)�bytesr=rDs r�%get_and_fixup_unknown_message_contentrKUs�������#�$�$r
�messagec���dj||f�|d<|rzt|dd�s8|j}|D�cgc]!}|j|j	|g����#}}	|D],}|j
r|j
d�|||j<�.yycc}w#tjj$r:}tdjj|j����|�d}~wwxYw)N�/zContent-Typerr5zInvalid header: {})�policy)
r.�hasattrrO�header_factory�header_source_parse�defectsr5�emailr<�HeaderDefect�
ValueError�format�fold)rr�subtype�headers�mp�header�excs       r�_prepare_setr^as����(�(�H�g�#6�7�C�����w�q�z�6�*����B�%,�.�%,�6�)�r�(�(�"�*@�*@�&��*J�K�%,�
�.�	J�!���>�>� �.�.��+�+�#)��F�K�K� �"�
��.���|�|�(�(�	J��1�8�8� &���3�:�:�� >�@�A�FI�
J��	J�s�&B�!1B�C0�65C+�+C0c��|�|�d}|�||d<|�|jd|dd��|�||d<|�+|j�D]\}}|j||��yy)N�
attachmentzContent-Disposition�filenameT)r\�replacez
Content-ID)�	set_param�items)r�dispositionra�cid�paramsr�values       r�
_finalize_setrirs�����x�3�"����%0��!�"����
�
�j��2�"�	�	$�����L��
�� �,�,�.�J�C���M�M�#�u�%�)�r
c���g}|dzdz}tdt|�|�D]=}||||z}|jtj|�jd���?dj
|�S)N��r�asciir)�range�len�append�binascii�
b2a_base64r9r.)�data�max_line_length�
encoded_lines�unencoded_bytes_per_line�i�thislines      r�_encode_base64ry�sv���M�.�!�3�a�7��
�1�c�$�i�!9�
:����!�4�4�5�����X�0�0��:�A�A�'�J�K�;��7�7�=�!�!r
c����|j|�j�}|jjd���fd�}d�}|��td�|D�d��|jkr	d||�jd�fS||dd
�}tj|jd�|j�}tj|�}	t|�t|	�kDrd}nd
}t|�d
kr||fS|dk(r||�jd�}
||
fS|dk(r||�jdd	�}
||
fS|d
k(r9tj||�jd�|j�}
||
fS|dk(r t||�|j�}
||
fStdj|���#t$rYnwxYw|jdk(s��[d||�jdd	�fS)Nrmc�,���j|��zSr�r.)�lines�lineseps �r�
embedded_bodyz#_encode_text.<locals>.embedded_body�s���W�\�\�%�%8�7�%B�Br
c�*�dj|�dzS)N�
r|)r}s r�normal_bodyz!_encode_text.<locals>.normal_body�s��5�:�:�e�#4�u�#<�<r
c3�2K�|]}t|����y�wr)ro)�.0�xs  r�	<genexpr>z_encode_text.<locals>.<genexpr>�s����&��1��A���s�r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr~�maxrtr9�UnicodeDecodeError�cte_typer�body_encoderqrrroryrVrW)�stringr:�cterOr}rr��sniff�sniff_qp�sniff_base64rsr~s           @r�_encode_textr��s����M�M�'�"�-�-�/�E��n�n�#�#�G�,�G�B�<�
�{��&��&��2�f�6L�6L�L�
��{�5�1�8�8��A�A�A�
�e�C�R�j�)���)�)�%�,�,�y�*A�*0�*@�*@�B���*�*�5�1���x�=�3�|�,�,��C�$�C��5�z�R���H�}�$�
�f�}��5�!�(�(��1����9��

����5�!�(�(��2C�D����9��

�"�	"��%�%�k�%�&8�&?�&?�	�&J�&,�&<�&<�>����9��	

����m�E�2�F�4J�4J�K����9���?�F�F�s�K�L�L��3&�
��
�����&�(��{�5�1�8�8��BS�T�T�Ts�(F<�<	G�Gc
��t|d||	�t||||j�\}}
|j|
�|j	dt
jjj||�d��||d<t|||||�y)NrAr:T�rb�Content-Transfer-Encoding)
r^r�rO�set_payloadrcrTr:�ALIASES�getri)rr�rYr:r�rerarfrgrZ�payloads           r�set_text_contentr��s�����f�g�w�/�����c�j�j�A�L�C���O�O�G���M�M�)��-�-�'�'�+�+�G�W�=��� �(+�C�#�$��#�{�H�c�6�:r
c	�4�|dk(rtd��|dk(r%|dvrtdj|���|�dn|}n*|dk(r!|dvrtd	j|���d
}n|�d
}t|d||�|j|g�||d<t	|||||�y)
N�partialz4message/partial is not supported for Message objects�rfc822)Nr�r��binaryz*message/rfc822 parts do not support cte={}r�z
external-body)Nr�z1message/external-body parts do not support cte={}r�rLr�)rVrWr^r�ri)	rrLrYr�rerarfrgrZs	         r�set_message_contentr��s����)���O�P�P��(���6�6��<�C�C�C�H�J�
J���f���	�O�	#��n�$��C�J�J�3�O�Q�
Q���	������i��'�2��O�O�W�I��'*�C�#�$��#�{�H�c�6�:r
c
�r�t||||	�|dk(r"t||jj��}n]|dk(r+t	j
|ddd��}|j
d�}n-|dk(r|j
d�}n|d	vr|j
dd
�}|j|�||d<t|||||�y)Nr�)rtr�FT)�istextr\�	quotetabsrmr�)r�r�r�r�)	r^ryrOrtrq�b2a_qpr9r�ri)
rrsrrYr�rerarfrgrZs
          r�set_bytes_contentr��s�����h���1�
�h���d�C�J�J�4N�4N�O��	�"�	"����t�E�%�4�P���{�{�7�#��	����{�{�7�#��	�"�	"��{�{�7�$5�6���O�O�D��'*�C�#�$��#�{�H�c�6�:r
r�)�plainzutf-8NNNNNN)r�NNNNNN)r�NNNNN)rq�
email.charsetrT�
email.message�email.errorsrr�raw_data_managerr@rrE�splitrrHrYrKr^riryr�r�r�strr�rL�Messager�rJ�	bytearray�
memoryviewr1r6r
r�<module>r�s[�������3,�3,�l"�#��2�� � ��)9�:�(�/�5�5�7�H��$�$�X�/C�D�8���%�+�+�-�G��$�$�Z��%7�9L�M�.��%�� � ��!F�H�J�"&�*"�$�NIM�:>�*.�
;�� � ��&6�7�=A�<@�,0�;�<� � ����!6�!6�8K�L�9A�:>�*.�;�&
�9�j�)�C��$�$�S�*;�<�*�r