Hacked By AnonymousFox

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

�

0�f^���	gd�ZddlZddlZddlZddlZddlmZddlmZ	e	jZ
dZdZdZ
dZd	Zd
ZdZe
d�Ze
d
�Zej(dej*ej,z�Zej(d�Zej(d�Zej4j6Zd�Z		dd�ZGd�d�ZGd�d�ZGd�de �Z!y))�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � z        ��Nz 	�us-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  z[\041-\176]+:$z
\n[^ \t]+:c
��	t|d�rG|jD��cgc]/\}}tj|t	|��t	|�f��1c}}St
j
|�s|dfgSg}|j�D]�}t
j|�}d}|s�|jd�}|r|j�}d}|r|j|ddf�|rc|jd�j�}|jd�j�}|jd�}	|j|	||f�|r����g}
t|�D]K\}}|dkDs�|ds�||dz
ds�||dz
dj�s�8|
j|dz
��Mt|
�D]}
||
=�g}|D]�\}}}|�|j||f��|dk(r3t j"j%|�}|j||f��U|dk(rOt'|�d	z}|r|d
dd	|z
z
}	t j(j+|�}|j||f���t3d|z��g}dx}}|D]Y\}}t5|t�rt7|d
�}|�|}|}�)||k7r|j||f�|}|}�F|�
|t8|zz
}�U||z
}�[|j||f�|Scc}}w#t,j.$rt1d��wxYw)N�_chunksTrF���q�b�z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)�hasattrr�_charset�_encode�str�ecre�search�
splitlines�split�pop�lstrip�append�lower�	enumerate�isspace�reversed�email�
quoprimime�
header_decode�len�
base64mime�decode�binascii�Errorr�AssertionError�
isinstance�bytes�BSPACE)�header�stringr�words�line�parts�first�	unencoded�encoding�encoded�droplist�n�w�d�
decoded_words�encoded_string�word�paderr�	collapsed�	last_word�last_charsets                     �3/opt/alt/python312/lib64/python3.12/email/header.pyrr;s8����v�y�!�+1�>�>�;�'����!�!�&�#�g�,�7��W��F�;�	;��;�;�v�������
�E��!�!�#���
�
�4� ������	�	�!��I��%�,�,�.�	�������i��t�4�5���)�)�A�,�,�,�.�� �9�9�Q�<�-�-�/���)�)�A�,�����g�x��9�:��$�"�H��%� ���1��Q�3�1�Q�4�E�!�A�#�J�q�M�e�A�a�C�j��m�.C�.C�.E��O�O�A�a�C� �!��h�
���!�H� ��M�-2�)���'���� � �.�'�!:�;�
��_��#�#�1�1�.�A�D�� � �$���1�
��_���(�1�,�F���%���V��"4�4��
6��'�'�.�.�~�>���$�$�d�G�_�5� �!8�8�!C�D�D�%.3�*�I�#�#�I��&�
��g��d�C� ���3�4�D����I�"�L�
��
$����i��6�7��I�"�L�
�
!���$��&�I����I�'����i��.�/����W;��d�>�>�
@�&�'>�?�?�
@�s�4K&�+K,�,Lc��	t|||��}|D]4\}}|�t|t�st|�}|j||��6|S)N)�
maxlinelen�header_name�continuation_ws)rr-�Charsetr)�decoded_seqrFrGrH�h�srs       rDrr�sV��	�	�*�+�.�	0�A�!�
��7���z�'�7�'C��g�&�G�	����G��	"�

�H�c�B�eZdZ			d	d�Zd�Zd�Zd
d�Zd�Zdd�Zd�Z	y)rNc��	|�t}nt|t�st|�}||_||_g|_|�|j
|||�|�t}||_|�d|_	yt|�dz|_	y)Nrr)�USASCIIr-rIr�_continuation_wsrr�
MAXLINELEN�_maxlinelen�
_headerlenr')�selfrLrrFrGrH�errorss       rD�__init__zHeader.__init__�s���	�4�?��G��G�W�-��g�&�G���
� /�������=��K�K��7�F�+���#�J�%������D�O�"�+�.��2�D�OrMc��	|j�g}d}d}|jD]�\}}|}|tjk(r$|j	dd�}|jdd�}|rU|xr|j
|d�}|dvr|dvr5|s3|jt�d}n|dvr|s|jt�|xr|j
|d�}|}|j|���tj|�S)N�ascii�surrogateescape�replacer�Nr
���)�
_normalizerr�UNKNOWN8BIT�encoder)�	_nonctextr�SPACE�EMPTYSTRING�join)	rU�uchunks�lastcs�	lastspacer1r�nextcs�original_bytes�hasspaces	         rD�__str__zHeader.__str__�s���4����������	�#�|�|�O�F�G��F���-�-�-�!'���w�8I�!J��'�.�.�w�	�B���!�?�d�n�n�V�A�Y�&?���!3�3��!3�3�H����u�-�!%���#5�5�i��N�N�5�)��=�4�>�>�&��*�#=�I��F��N�N�6�"�+ ,�,����(�(rMc��|t|�k(S�N)r)rU�others  rD�__eq__z
Header.__eq__�s����D�	�!�!rMc���	|�
|j}nt|t�st|�}t|t�sH|jxsd}|tj
k(r|j
dd�}n|j
||�}|jxsd}|tj
k7r	|j||�|jj||f�y#t$r|dk7r�t}Y�5wxYw)Nr
rZ)
rr-rIr�input_codecr_r)�output_codecr`�UnicodeEncodeError�UTF8rr)rUrLrrV�
input_charset�output_charsets      rDrz
Header.appends���	�(�?��m�m�G��G�W�-��g�&�G��!�S�!�#�/�/�=�:�M��� 4� 4�4��H�H�Z�):�;���H�H�]�F�3��!�-�-�;����X�1�1�1�
������0�
	
�����Q��L�)��	&�
�!�:�-����
�s�(C�C0�/C0c�0�	|j�xs|dvS)N)�(�)�\)r")rUrLs  rDrazHeader._nonctext0s��	��y�y�{�3�a�#3�3�3rMc�0�	|j�|�|j}|dk(rd}t|j||j|�}d}dx}}|j
D�][\}}	|�I|xr|j
|d�}|dvr|r|	dvr'|j�n|	dvr|s|j�|xr|j
|d�}|	}d}|j�}
|
r|jd|
d|	�n|jdd|	�|
ddD]�}|j�|	j�/|j|jd|j�z|	��N|j�}|dt|�t|�z
}
|j|
||	���t|
�dkDs��L|j���^|j
r|j�|j|�}tj!|�rt#d	j%|���|S)
Nri@Br\r]Frrr	z8header value appears to contain an embedded header: {!r})r^rS�_ValueFormatterrTrQrra�add_transitionr�feed�newline�header_encodingrr'�_str�_embedded_headerrr�format)rU�
splitcharsrF�linesep�	formatterrfrjrgr1r�linesr3�sline�fws�values               rDr`z
Header.encode5s	��	�@	
�������)�)�J���?� �J�#�D�O�O�Z�$(�$9�$9�:�G�	���#�#��9�#�|�|�O�F�G��#�!�?�d�n�n�V�A�Y�&?���!3�3�#�w�6H�'H�!�0�0�2��$6�6�y��,�,�.��=�4�>�>�&��*�#=�I��F��H��%�%�'�E�����r�5��8�W�5����r�2�w�/��a�b�	���!�!�#��*�*�6��N�N�4�#8�#8�#����
�:M�#*�,�!�K�K�M�E��4��D�	�#�e�*� 4�5�C��N�N�3��w�7�"��5�z�A�~��!�!�#�5 ,�6�<�<��$�$�&����w�'���"�"�5�)�"�$+�+1�6�%�=�:�
:��rMc��g}d}g}|jD]I\}}||k(r|j|��|�&|jtj|�|f�|g}|}�K|r&|jtj|�|f�||_yrm)rrrbrd)rU�chunksrC�
last_chunkr1rs      rDr^zHeader._normalize�s��������
�#�|�|�O�F�G��,�&��!�!�&�)��+��M�M�5�:�:�j�#9�<�"H�I�$�X�
�&�� ,���M�M�5�:�:�j�1�<�@�A���rM)NNNNr	�strict)Nr�)z;, 	Nr)
�__name__�
__module__�__qualname__rWrkrorrar`r^�rMrDrr�s3��'+�.2�-5�-3�^)�@"�)*�V4�
N�`rMrc�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)r|c�|�||_||_t|�|_||_g|_t
|�|_yrm)�_maxlenrQr'�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rU�	headerlen�maxlenrHr�s     rDrWz_ValueFormatter.__init__�s:����� /���$'��$8��!�%������)�)�4��rMc�X�|j�|j|j�Srm)rrdr�)rUr�s  rDr�z_ValueFormatter._str�s�������|�|�D�K�K�(�(rMc�,�|jt�Srm)r��NL�rUs rDrkz_ValueFormatter.__str__�s���y�y��}�rMc���|jj�}|dk7r|jj|�t|j�dkDr|jj	�r7|j
r+|j
dxxt
|j�z
cc<n.|j
jt
|j��|jj�y)N)r	rrr])	r�r�pushr'�	is_onlywsr�rr�reset)rU�end_of_lines  rDrz_ValueFormatter.newline�s����(�(�,�,�.���)�#�#�D���#�#�[�1��t�!�!�"�Q�&��!�!�+�+�-�$�+�+����B��3�t�'9�'9�#:�:�����"�"�3�t�'9�'9�#:�;���� � �"rMc�<�|jjdd�y)Nr	r)r�r�r�s rDr}z_ValueFormatter.add_transition�s��������R�(rMc��|j�|j|||j�y|j||j	��}	|jd�}|�|j||�	|j�}|j�|jj|j|�|D]*}|jj|j|z��,y#t$rYywxYw#t$rYywxYw�Nr)r��_ascii_splitr��header_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrr�r�rQr�r)rUr�r1r�
encoded_lines�
first_line�	last_liner3s        rDr~z_ValueFormatter.feed�s����"�"�*����c�6�4�+;�+;�<�� �3�3�F�D�<L�<L�<N�O�
�	�&�*�*�1�-�J��!����s�J�/�	�%�)�)�+�I�	
���������� 5� 5�y�A�!�D��K�K���t�4�4�t�;�<�"���	��	���	��	�s$�C(�2C7�(	C4�3C4�7	D�Dc#�K�|jt|j�z
��	|j|jz
����wrm)r�r'r�r�r�s rDr�z_ValueFormatter._maxlengths�s=�����l�l�S��!3�!3�4�4�4���,�,��!:�!:�:�:��s�AAc���tjdtzdz||z�}|drdg|ddn|jd�t	t|�gdz�D]\}}|j
||��y)Nz([z]+)rrr)�rer�FWSr�zip�iterr�)rUr�r1r�r4�parts      rDr�z_ValueFormatter._ascii_split�sl������c��%���V��4����8���E�"�1�I��I�I�a�L��t�E�{�m�A�o�.�I�C�����s�D�)�/rMc�:�|jj||�t|j�|jkD�r\|jD]�}t|jj
�dz
dd�D]R}|j�r|j|d}|r
|d|k(rn%|j|dz
d}|s�I|d|k(s�Rn��nh|jj�\}}|jjdkDr|j�|sd}|jj||�y|jj|�}|jjt|j��|jj|�yy)Nrrr]r	)r�r�r'r�r��range�
part_countr"r�
_initial_sizer�pop_fromr�rrr�)rUr�r1�ch�i�prevpartr��	remainders        rDr�z_ValueFormatter._append_chunk�so��������V�,��t�!�!�"�T�\�\�1��&�&���t�1�1�<�<�>�q�@�!�R�H�A��z�z�|�"�0�0��3�A�6���3�q�6�2�:�!�#�1�1�!�A�#�6�q�9�H��H�R�L�"�$4��I���'�!�.�.�2�2�4�	��T��%�%�3�3�a�7��L�L�N��"���"�"�'�'��T�2���*�*�3�3�A�6�I��K�K���s�4�#5�#5�6�7����$�$�Y�/�92rMN)r�r�r�rWr�rkrr}r~r�r�r�r�rMrDr|r|�s0��5�)��	#�)�#=�J;�*�,0rMr|c�\��eZdZd
�fd�	Zd�Zd
d�Z�fd�Zd�Zd�Zdd�Z	d�Z
�fd	�Z�xZS)r�c�0��||_t�|�	�yrm)r��superrW)rU�initial_size�	__class__s  �rDrWz_Accumulator.__init__s���)���
���rMc�*�|j||f�yrm)r)rUr�r1s   rDr�z_Accumulator.pushs�����S�&�M�"rMc��||d}g||d|Srmr�)rUr��poppeds   rDr�z_Accumulator.pop_from!s���a�b�����Q�R���
rMc�H��|j�dk(ryt�|�	�S)Nr)rr)r�r�r�rUr�s �rDrz_Accumulator.pop&s!����?�?��a����w�{�}�rMc�<�td�|D�|j�S)Nc3�PK�|]\}}t|�t|�z��� y�wrm)r'��.0r�r�s   rD�	<genexpr>z'_Accumulator.__len__.<locals>.<genexpr>,s!����=�9�3��C��H�S��Y�&�=���$&)�sumr�r�s rD�__len__z_Accumulator.__len__+s ���=��=��%�%�'�	'rMc�:�tjd�|D��S)Nc3�PK�|]\}}tj||f���� y�wrm�rcrdr�s   rDr�z'_Accumulator.__str__.<locals>.<genexpr>0s+����!7�$-�C��"-�!1�!1�3��+�!>�!7�r�r�r�s rDrkz_Accumulator.__str__/s"�����!7�15�!7�8�	8rMc�$�|�g}||ddd|_yr�)r�)rU�startvals  rDr�z_Accumulator.reset3s�����H���Q����rMc�`�|jdk(xr|xst|�j�Sr�)r�rr"r�s rDr�z_Accumulator.is_onlyws9s,���!�!�1�$�J�d�(�*I�c�$�i�6G�6G�6I�JrMc� ��t�|��Srm)r�r�r�s �rDr�z_Accumulator.part_count<s����w�� � rM)rrm)
r�r�r�rWr�r�rr�rkr�r�r��
__classcell__)r�s@rDr�r�s6����#��
�
'�8��K�!�!rMr�)NNr	)"�__all__r�r*�email.quoprimimer$�email.base64mime�email.errorsrrrrIr�rbr/�SPACE8rcrRr�rPrt�compile�VERBOSE�	MULTILINEr�fcrer�r%�_max_appendrrrr|�listr�r�rMrD�<module>r�s��
2���
����)�%�
�
�
��	����	
��	����
�
���
�*�
���w����r�z�z��
�z�z�B�L�L� �"���r�z�z�#�$���2�:�:�m�,�����*�*��[�|;?� #�
�,f�f�R}0�}0�@%!�4�%!rM

Hacked By AnonymousFox1.0, Coded By AnonymousFox