AlkantarClanX12

Your IP : 18.218.108.24


Current Path : /opt/alt/python311/lib64/python3.11/email/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/email/__pycache__/contentmanager.cpython-311.opt-1.pyc

�

c��f\)��|�ddlZddlZddlZddlZddlmZGd�d��Ze��Zdd�Ze�	de��d�Z
d	���D]Ze�	ee
���[d
�Z
d���D]Ze�	deze
���[d
�Ze�	de��d�Zd�Zd�Zd�Z			dd�Ze�ee��			dd�Ze�ejje��			dd�ZeeefD]Ze�ee���[dS)�N)�
quoprimimec�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�ContentManagerc�"�i|_i|_dS�N)�get_handlers�set_handlers)�selfs �;/opt/alt/python311/lib64/python3.11/email/contentmanager.py�__init__zContentManager.__init__	s����������c��||j|<dSr)r)r
�key�handlers   r�add_get_handlerzContentManager.add_get_handler
s��!(���#���r
c�0�|���}||jvr|j||g|�Ri|��S|���}||jvr|j||g|�Ri|��Sd|jvr|jd|g|�Ri|��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��D�D�D��+�+�-�-���t�(�(�(�.�4�$�X�.�s�@�T�@�@�@�R�@�@�@�
��"�"�"�(�4�$�R�(��:�t�:�:�:�r�:�:�:��|�$�$�$r
c��||j|<dSr)r	)r
�typekeyrs   r�add_set_handlerzContentManager.add_set_handlers��%,���'�"�"�"r
c���|���dkrtd���|�||��}|���|||g|�Ri|��dS)N�	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handler�
clear_content)r
r�objrrrs      r�set_contentzContentManager.set_contentsy���#�#�%�%��4�4��@�A�A�A��(�(��c�2�2�����������S�&�4�&�&�&�2�&�&�&�&�&r
c��d}t|��jD]�}||jvr|j|cS|j}t	|dd��}|rd�||f��n|}|�|}||jvr|j|cS||jvr|j|cS|j}||jvr|j|cS��d|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�9�$�	/�	/�C��d�'�'�'��(��-�-�-�-��$�E��c�<��4�4�G�6=�H����'�5�!1�2�2�2�5�I�"�*�&/�#��D�-�-�-��(��3�3�3�3���)�)�)��(��/�/�/�/��<�D��t�(�(�(��(��.�.�.�.�)��4�$�$�$��$�T�*�*��*�+�+�+r
N)	r/r(r,rrrrr&r#�r
rrrsn���������)�)�)�	%�	%�	%�-�-�-�'�'�'�,�,�,�,�,r
r�replacec��|�d���}|�dd��}|�||���S)NT��decode�charset�ASCII)�errors)�get_payload�	get_paramr:)rr=�contentr;s    r�get_text_contentrA@s>���o�o�T�o�*�*�G��m�m�I�w�/�/�G��>�>�'�&�>�1�1�1r
�textc�.�|�d���S)NTr9�r>�rs r�get_non_text_contentrFGs���?�?�$�?�'�'�'r
zaudio image video applicationc�,�|�d��S�NrrDrEs r�get_message_contentrINs���?�?�1���r
zrfc822 external-bodyzmessage/c�F�t|�d����SrH)�bytesr>rEs r�%get_and_fixup_unknown_message_contentrLUs�������#�#�$�$�$r
�messagec���d�||f��|d<|r�t|dd��s|j��fd�|D��}	|D] }|jr
|jd�|||j<�!dS#t
jj$rA}td�	|�
|j�������|�d}~wwxYwdS)N�/zContent-Typerr5c�L��g|] }�j��|g�����!Sr6)�header_factory�header_source_parse)�.0�header�mps  �r�
<listcomp>z _prepare_set.<locals>.<listcomp>fsC���.�.�.�!�)�r�(�"�*@�*@�&��*J�*J�K�.�.�.r
zInvalid header: {})�policy)r.�hasattrrW�defectsr5�emailr=�HeaderDefect�
ValueError�format�fold)rr�subtype�headersrT�excrUs      @r�_prepare_setrbas'����(�(�H�g�#6�7�7�C����J��w�q�z�6�*�*�	.���B�.�.�.�.�%,�.�.�.�G�	J�!�
*�
*���>�,� �.��+�+�#)��F�K� � �
*�
*���|�(�	J�	J�	J��1�8�8� &���3�:�� >� >�@�@�A�A�FI�
J�����	J����J�Js�
#A/�/C�<B?�?Cc���|�|�d}|�||d<|�|�d|dd���|�||d<|�0|���D]\}}|�||���dSdS)N�
attachmentzContent-Disposition�filenameT)rTr7z
Content-ID)�	set_param�items)r�dispositionre�cid�paramsr�values       r�
_finalize_setrlrs�����x�3�"����%0��!�"����
�
�j��2�"�	�	$�	$�	$�����L��
�� �,�,�.�.�	&�	&�J�C���M�M�#�u�%�%�%�%���	&�	&r
c��g}|dzdz}tdt|��|��D]I}||||z�}|�tj|���d�����Jd�|��S)N��r�asciir)�range�len�append�binascii�
b2a_base64r:r.)�data�max_line_length�
encoded_lines�unencoded_bytes_per_line�i�thislines      r�_encode_base64r|�s����M�.�!�3�a�7��
�1�c�$�i�i�!9�
:�
:�L�L����!�4�4�4�5�����X�0��:�:�A�A�'�J�J�K�K�K�K�
�7�7�=�!�!�!r
c�d��|�|�����}|j�d����fd�}d�}|��td�|D��d���|jkr]	d||���d��fS#t$rYnwxYw|jdkr!d||���dd	��fS||dd
���}tj	|�d��|j��}tj|��}	t|��t|	��krd}nd
}t|��d
kr||fS|dkr||���d��}
n�|dkr ||���dd	��}
n�|d
kr7tj	||���d��|j��}
nG|dkrt||��|j��}
n"td�|�����||
fS)Nrpc�4����|���zSr�r.)�lines�lineseps �r�
embedded_bodyz#_encode_text.<locals>.embedded_body�s���W�\�\�%�%8�%8�7�%B�Br
c�2�d�|��dzS)N�
r)r�s r�normal_bodyz!_encode_text.<locals>.normal_body�s��5�:�:�e�#4�#4�u�#<�<r
c3�4K�|]}t|��V��dSr)rr)rS�xs  r�	<genexpr>z_encode_text.<locals>.<genexpr>�s(����&�&�1��A���&�&�&�&�&�&r
r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr��maxrwr:�UnicodeDecodeError�cte_typer�body_encodertrurrr|r\r])�stringr;�cterWr�r�r��sniff�sniff_qp�sniff_base64rvr�s           @r�_encode_textr��sg����M�M�'�"�"�-�-�/�/�E��n�#�#�G�,�,�G�B�B�B�B�B�<�<�<�
�{��&�&��&�&�&��2�2�2�f�6L�L�L�
��{�{�5�1�1�8�8��A�A�A�A��%�
�
�
���
������&�(�(��{�{�5�1�1�8�8��BS�T�T�T�T��
�e�C�R�C�j�)�)���)�%�,�,�y�*A�*A�*0�*@�B�B���*�5�1�1���x�=�=�3�|�,�,�,�,��C�C�$�C��5�z�z�R����H�}�$�
�f�}�}��{�5�!�!�(�(��1�1���	�����{�5�!�!�(�(��2C�D�D���	�"�	"�	"��%�k�k�%�&8�&8�&?�&?�	�&J�&J�&,�&<�>�>���	�����m�m�E�2�2�F�4J�K�K����?�F�F�s�K�K�L�L�L���9�s�3B�
B �B �plain�utf-8c
�.�t|d||	��t||||j��\}}
|�|
��|�dt
jj�||��d���||d<t|||||��dS)NrBr;T�r7�Content-Transfer-Encoding)
rbr�rW�set_payloadrfrZr;�ALIASES�getrl)rr�r_r;r�rhrerirjr`�payloads           r�set_text_contentr��s�����f�g�w�/�/�/�����c�j�A�A�L�C���O�O�G�����M�M�)��-�'�+�+�G�W�=�=��� � � �(+�C�#�$��#�{�H�c�6�:�:�:�:�:r
�rfc822c	�|�|dkrtd���|dkr-|dvr"td�|�����|�dn|}n3|dkr)|dvr"td	�|�����d
}n|�d
}t|d||��|�|g��||d<t	|||||��dS)
N�partialz4message/partial is not supported for Message objectsr�)Nr�r��binaryz*message/rfc822 parts do not support cte={}r�z
external-body)Nr�z1message/external-body parts do not support cte={}r�rMr�)r\r]rbr�rl)	rrMr_r�rhrerirjr`s	         r�set_message_contentr��s
���)����O�P�P�P��(����6�6�6��<�C�C�C�H�H�J�J�
J���f�f����	�O�	#�	#��n�$�$��C�J�J�3�O�O�Q�Q�
Q����	������i��'�2�2�2��O�O�W�I����'*�C�#�$��#�{�H�c�6�:�:�:�:�:r
r�c
��t||||	��|dkrt||jj���}nj|dkr.t	j|ddd���}|�d��}n6|dkr|�d��}n|d	vr|�dd
��}|�|��||d<t|||||��dS)Nr�)rwr�FT)�istextrT�	quotetabsrpr�)r�r�r�r�)	rbr|rWrwrt�b2a_qpr:r�rl)
rrvrr_r�rhrerirjr`s
          r�set_bytes_contentr��s�����h���1�1�1�
�h����d�C�J�4N�O�O�O���	�"�	"�	"���t�E�%�4�P�P�P���{�{�7�#�#���	�����{�{�7�#�#���	�"�	"�	"��{�{�7�$5�6�6���O�O�D����'*�C�#�$��#�{�H�c�6�:�:�:�:�:r
r�)r�r�NNNNNN)r�NNNNNN)r�NNNNN)rt�
email.charsetrZ�
email.message�email.errorsrr�raw_data_managerrArrF�splitrrIr_rLrbrlr|r�r�r�strr�rM�Messager�rK�	bytearray�
memoryviewr1r6r
r�<module>r�s�������������������������3,�3,�3,�3,�3,�3,�3,�3,�l"�>�#�#��2�2�2�2�� � ��)9�:�:�:�(�(�(�/�5�5�7�7�E�E�H��$�$�X�/C�D�D�D�D�����%�+�+�-�-�N�N�G��$�$�Z��%7�9L�M�M�M�M��%�%�%�� � ��!F�H�H�H�J�J�J�"&�&�&�*"�"�"�$�$�$�NIM�:>�*.�
;�
;�
;�
;�� � ��&6�7�7�7�=A�<@�,0�;�;�;�;�<� � ���!6�8K�L�L�L�9A�:>�*.�;�;�;�;�&
�9�j�)�=�=�C��$�$�S�*;�<�<�<�<��C�Cr