Your IP : 18.218.250.241


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

�

�Q�fSQ��*�	ddlmZddlmZddlmZddlmZGd�d�ZGd�d�ZGd	�d
e	�Z
d�ZGd�d
�ZGd�de�Z
Gd�d�ZGd�de�ZGd�d�ZGd�de�ZGd�de�ZGd�de�ZGd�d�ZGd�d�ZGd �d!e�ZGd"�d#e�ZGd$�d%�ZGd&�d'�Zid(e
�d)e�d*e�d+e�d,e�d-e�d.e�d/e�d0e�d1e�d2e�d3e�d4e�d5e�d6e�d7e�d8e�eeed9��ZGd:�d;�Zy<)=�)�MappingProxyType)�utils)�errors)�_header_value_parserc�f�eZdZd
d�Zed��Zed��Zed��Zed��Zd�Z	d�Z
d	�Zy)�AddressNc	��	djtd||||f��}d|vsd|vrtd��|�w|s|rtd��t	j
|�\}}|rtdj
||���|jr|jd�|j}|j}||_
||_||_y)N��
�
z8invalid arguments; address parts cannot contain CR or LFz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r)
�join�filter�
ValueError�	TypeError�parser�
get_addr_spec�format�all_defects�
local_part�domain�
_display_name�	_username�_domain)�self�display_name�usernamer�	addr_spec�inputs�a_s�rests        �;/opt/alt/python312/lib64/python3.12/email/headerregistry.py�__init__zAddress.__init__s���	� �����|�X�v�y�&Q�R�S���6�>�T�V�^��W�X�X�� ��6��!8�9�9��,�,�Y�7�I�C��� �"=�=C�V�$'��>4�5�5�����o�o�a�(�(��~�~�H��Z�Z�F�)���!������c��|jS�N�r�rs r!rzAddress.display_name8����!�!�!r#c��|jSr%)rr's r!rzAddress.username<����~�~�r#c��|jSr%)rr's r!rzAddress.domain@����|�|�r#c���	|j}tjj|�stj|�}|j
r|dz|j
zS|sy|S)N�@�<>)rr�
DOT_ATOM_ENDS�
isdisjoint�quote_stringr)r�lps  r!rzAddress.addr_specDs[��	��]�]���#�#�.�.�r�2��$�$�R�(�B��;�;���8�d�k�k�)�)����	r#c��dj|jj|j|j|j
�S)Nz1{}(display_name={!r}, username={!r}, domain={!r}))r�	__class__�__name__rrrr's r!�__repr__zAddress.__repr__Rs9��B�I�I����/�/��)�)�4�=�=�$�+�+�G�	Gr#c��|j}tjj|�stj|�}|r/|j
dk(rdn|j
}dj
||�S|j
S)Nr/r
z{} <{}>)rr�SPECIALSr1r2rr)r�disprs   r!�__str__zAddress.__str__Wse��� � �����)�)�$�/��&�&�t�,�D��"�n�n�d�2�����I��#�#�D�)�4�4��~�~�r#c���t|t�stS|j|jk(xr4|j|jk(xr|j
|j
k(Sr%)�
isinstancer�NotImplementedrrr�r�others  r!�__eq__zAddress.__eq__`sU���%��)�!�!��!�!�U�%7�%7�7�,��
�
����/�,����u�|�|�+�	-r#)r
r
r
N)r6�
__module__�__qualname__r"�propertyrrrrr7r;rA�r#r!rrsh��(�T�"��"�������������G�
�-r#rc�F�eZdZdd�Zed��Zed��Zd�Zd�Zd�Z	y)	�GroupNc�X�	||_|rt|�|_yt�|_yr%)r�tuple�
_addresses)rr�	addressess   r!r"zGroup.__init__js'��
	�*���.7�%�	�*���U�W��r#c��|jSr%r&r's r!rzGroup.display_name|r(r#c��|jSr%)rJr's r!rKzGroup.addresses�s�����r#c�x�dj|jj|j|j�S)Nz${}(display_name={!r}, addresses={!r})rr5r6rrKr's r!r7zGroup.__repr__�s1��5�<�<����(�(��"�"�D�N�N�4�	4r#c�x�|j�0t|j�dk(rt|jd�S|j}|�4tj
j
|�st	j|�}djd�|jD��}|rd|zn|}dj||�S)N�r�, c3�2K�|]}t|����y�wr%)�str)�.0�xs  r!�	<genexpr>z Group.__str__.<locals>.<genexpr>�s����:�>�a�3�q�6�>�s�� z{}:{};)
r�lenrKrSrr9r1r2r
r)rr:�adrstrs   r!r;z
Group.__str__�s������$��T�^�^�)<�a�)?��t�~�~�a�(�)�)�� � ����F�O�O�$>�$>�t�$D��&�&�t�,�D����:�4�>�>�:�:��!'��v��V�����t�V�,�,r#c��t|t�stS|j|jk(xr|j|jk(Sr%)r=rGr>rrKr?s  r!rAzGroup.__eq__�s@���%��'�!�!��!�!�U�%7�%7�7�2����%�/�/�1�	3r#)NN)
r6rBrCr"rDrrKr7r;rArEr#r!rGrGhs?��E�$�"��"�����4�
-�3r#rGc�V�eZdZ	d�Zd�Zed��Zed��Zd�Ze	d��Z
d�Zy)	�
BaseHeaderc��dgi}|j||�tj|d�rtj|d�|d<tj||d�}|d=|j|fi|��|S)N�defects�decoded)�parser�_has_surrogates�	_sanitizerS�__new__�init)�cls�name�value�kwdsrs     r!rczBaseHeader.__new__�st���2����	�	�%���� � ��i��1�#�o�o�d�9�o�>�D��O��{�{�3��Y��0����O���	�	�$��$���r#c�.�||_||_||_yr%)�_name�_parse_tree�_defects)rrf�
parse_treer^s    r!rdzBaseHeader.init�s����
�%�����
r#c��|jSr%)rjr's r!rfzBaseHeader.name�s���z�z�r#c�,�t|j�Sr%)rIrlr's r!r^zBaseHeader.defects�s���T�]�]�#�#r#c��t|jj|jjt	|�f|j�fSr%)�_reconstruct_headerr5r6�	__bases__rS�__getstate__r's r!�
__reduce__zBaseHeader.__reduce__�sC������'�'����(�(��D�	�
�

����!�	!r#c�.�tj||�Sr%)rSrc)rergs  r!�_reconstructzBaseHeader._reconstruct�s���{�{�3��&�&r#c	��	tjtjtj|jd�tjdd�g�g�}|j
r9|j
tjtjdd�g��|j
|j
�|j|��S)Nzheader-name�:z
header-seprW�fws)�policy)
r�Header�HeaderLabel�
ValueTerminalrfrk�append�CFWSList�WhiteSpaceTerminal�fold)rrz�headers   r!r�zBaseHeader.fold�s���	� �������$�$�T�Y�Y�
�>��$�$�S�,�7� 9�
:� ���
����M�M�����!:�!:�3��!F� G�H�
J��
�
�d�&�&�'��{�{�&�{�)�)r#N)r6rBrCrcrdrDrfr^rt�classmethodrvr�rEr#r!r\r\�sX���@� �
�����$��$�!��'��'�*r#r\c�:�t||i�j|�Sr%)�typerv)�cls_name�basesrgs   r!rqrqs����%��$�1�1�%�8�8r#c�D�eZdZdZeej�Zed��Z	y)�UnstructuredHeaderNc�N�|j|�|d<t|d�|d<y)Nrmr_)�value_parserrS�rergrhs   r!r`zUnstructuredHeader.parse	s*�� �-�-�e�4��\���d�<�0�1��Y�r#)
r6rBrC�	max_count�staticmethodr�get_unstructuredr�r�r`rEr#r!r�r�s)���I��� 7� 7�8�L��2��2r#r�c��eZdZdZy)�UniqueUnstructuredHeaderrPN�r6rBrCr�rEr#r!r�r�����Ir#r�c�h��eZdZ	dZeej�Zed��Z	�fd�Z
ed��Z�xZ
S)�
DateHeaderNc��|sH|djtj��d|d<d|d<tj�|d<yt|t�r||d<	tj|�}||d<tj|d�|d<|j|d�|d<y#t$rF|djtjd��d|d<tj�|d<YywxYw)Nr^�datetimer
r_rmzInvalid date value or format)
r~r�HeaderMissingRequiredValuer�	TokenListr=rSr�parsedate_to_datetimer�InvalidDateDefect�format_datetimer�r�s   r!r`zDateHeader.parse$s������O�"�"�6�#D�#D�#F�G�#�D��� �D��O�!'�!1�!1�!3�D�����e�S�!�#�D��O�
��3�3�E�:��!��Z���/�/��Z�0@�A��Y�� �-�-�d�9�o�>��\����
��Y��&�&�v�'?�'?�@^�'_�`�#'��Z� �%+�%5�%5�%7��\�"��	
�s�!B.�.AC=�<C=c�P��|jd�|_t�|�|i|��y)Nr�)�pop�	_datetime�superrd�r�args�kwr5s   �r!rdzDateHeader.init9s$������
�+���
���d�!�b�!r#c��|jSr%)r�r's r!r�zDateHeader.datetime=r*r#)r6rBrCr�r�rr�r�r�r`rdrDr��
__classcell__�r5s@r!r�r�sL�����I� �� 7� 7�8�L��?��?�("����r#r�c��eZdZdZy)�UniqueDateHeaderrPNr�rEr#r!r�r�Br�r#r�c�b��eZdZdZed��Zed��Z�fd�Ze	d��Z
e	d��Z�xZS)�
AddressHeaderNc�6�tj|�\}}|Sr%)r�get_address_list)rg�address_lists  r!r�zAddressHeader.value_parserKs��$�5�5�e�<���e��r#c��t|t�r�|j|�x|d<}g}|jD]t}|j	t|j|jD�cgc]9}t|jxsd|jxsd|jxsd���;c}���vt|j�}n9t|d�s|g}|D�cgc]}t|d�s
td|g�n|��}}g}||d<||d<dj|D�cgc]
}t|���c}�|d<d|vr|j|d�|d<yycc}wcc}wcc}w)	Nrmr
�__iter__rK�groupsr^rQr_)r=rSr�rKr~rGr�
all_mailboxesrrr�listr�hasattrr
)	rergrhr�r��addr�mbr^�items	         r!r`zAddressHeader.parseQs����e�S�!�14�0@�0@��0G�G�D�����F�$�.�.���
�
�e�D�$5�$5�04�/A�/A�%C�0B��&-�R�_�_�-B��-/�]�]�-@�b�-/�Y�Y�_�"�&>�0B�%C�D�E�/��<�3�3�4�G��5�*�-����16�7�05��29��{�1K�e�D�4�&�)�/3�4�05�
�7��G���X��!��Y���)�)�6�$B�6�4�S��Y�6�$B�C��Y���t�#�!$�!1�!1�$�y�/�!B�D���$��!%C��7��%Cs�!>E
�"E�Ec�p��t|jd��|_d|_t	�|�|i|��y)Nr�)rIr��_groupsrJr�rdr�s   �r!rdzAddressHeader.initms0����R�V�V�H�-�.������
���d�!�b�!r#c��|jSr%)r�r's r!r�zAddressHeader.groupsrr,r#c�t�|j�!td�|jD��|_|jS)Nc3�BK�|]}|jD]}|����y�wr%)rK)rT�group�addresss   r!rVz*AddressHeader.addresses.<locals>.<genexpr>ys(����$L���;@�?�?��%,�;J�%,��s�)rJrIr�r's r!rKzAddressHeader.addressesvs5���?�?�"�#�$L����$L�L�D�O����r#)
r6rBrCr�r�r�r�r`rdrDr�rKr�r�s@r!r�r�Gs]����I�����
�C��C�6"�
�������r#r�c��eZdZdZy)�UniqueAddressHeaderrPNr�rEr#r!r�r�~r�r#r�c��eZdZed��Zy)�SingleAddressHeaderc��t|j�dk7r$tdj|j���|jdS)NrPz9value of single address header {} is not a single addressr)rXrKrrrfr's r!r�zSingleAddressHeader.address�sB���t�~�~���!��#�$*�F�4�9�9�$5�7�
7��~�~�a� � r#N)r6rBrCrDr�rEr#r!r�r��s��
�!��!r#r�c��eZdZdZy)�UniqueSingleAddressHeaderrPNr�rEr#r!r�r��r�r#r�c���eZdZdZeej�Zed��Z	�fd�Z
ed��Zed��Z
ed��Z�xZS)�MIMEVersionHeaderrPc�:�|j|�x|d<}t|�|d<|dj|j�|j�dn|j
|d<|j|d<|j�dj
|d|d�|d<yd|d<y)Nrmr_r^�major�minorz{}.{}�version)r�rS�extendrr�r�r�rergrhrms    r!r`zMIMEVersionHeader.parse�s���*-�*:�*:�5�*A�A��\��Z��j�/��Y���Y����z�5�5�6� *� 0� 0� 8��j�>N�>N��W�
�"�(�(��W�
����'�%�n�n�T�'�]�D��M�J�D��O�"�D��Or#c���|jd�|_|jd�|_|jd�|_t	�|�|i|��y)Nr�r�r�)r��_version�_major�_minorr�rdr�s   �r!rdzMIMEVersionHeader.init�sB������y�)��
��f�f�W�o����f�f�W�o���
���d�!�b�!r#c��|jSr%)r�r's r!r�zMIMEVersionHeader.major�����{�{�r#c��|jSr%)r�r's r!r�zMIMEVersionHeader.minor�r�r#c��|jSr%)r�r's r!r�zMIMEVersionHeader.version�����}�}�r#)r6rBrCr�r�r�parse_mime_versionr�r�r`rdrDr�r�r�r�r�s@r!r�r��sk����I��� 9� 9�:�L��	#��	#�"������������r#r�c�B��eZdZdZed��Z�fd�Zed��Z�xZ	S)�ParameterizedMIMEHeaderrPc�f�|j|�x|d<}t|�|d<|dj|j�|j�i|d<y|jD��cic]<\}}tj|�j�tj|���>c}}|d<ycc}}w)Nrmr_r^�params)r�rSr�rr�rrb�lower)rergrhrmrfs     r!r`zParameterizedMIMEHeader.parse�s���*-�*:�*:�5�*A�A��\��Z��j�/��Y���Y����z�5�5�6����$��D��N�
3=�2C�2C�E�2C�;�4��$�o�o�d�3�9�9�;�$)�O�O�E�$:�;�2C�E�D��N��Es�$AB-c�P��|jd�|_t�|�|i|��y)Nr�)r��_paramsr�rdr�s   �r!rdzParameterizedMIMEHeader.init�s$����v�v�h�'���
���d�!�b�!r#c�,�t|j�Sr%)rr�r's r!r�zParameterizedMIMEHeader.params�s������-�-r#)
r6rBrCr�r�r`rdrDr�r�r�s@r!r�r��s7���
�I��
E��
E�"��.��.r#r�c�r��eZdZeej
�Z�fd�Zed��Z	ed��Z
ed��Z�xZS)�ContentTypeHeaderc����t�|�|i|��tj|jj
�|_tj|jj�|_yr%)	r�rdrrbrk�maintype�	_maintype�subtype�_subtyper�s   �r!rdzContentTypeHeader.init�sL���
���d�!�b�!�����)9�)9�)B�)B�C�������(8�(8�(@�(@�A��
r#c��|jSr%)r�r's r!r�zContentTypeHeader.maintype�r*r#c��|jSr%)r�r's r!r�zContentTypeHeader.subtype�r�r#c�:�|jdz|jzS)N�/)r�r�r's r!�content_typezContentTypeHeader.content_type�s���}�}�s�"�T�\�\�1�1r#)
r6rBrCr�r�parse_content_type_headerr�rdrDr�r�r�r�r�s@r!r�r��sU����� @� @�A�L�B�
���������2��2r#r�c�R��eZdZeej
�Z�fd�Zed��Z	�xZ
S)�ContentDispositionHeaderc���t�|�|i|��|jj}|�||_yt	j
|�|_yr%)r�rdrk�content_dispositionrrb�_content_disposition)rr�r��cdr5s    �r!rdzContentDispositionHeader.init�sA���
���d�!�b�!�
�
�
�
1�
1��*,�*�B��!�%�/�/�"�:M��!r#c��|jSr%)r�r's r!r�z,ContentDispositionHeader.content_disposition�s���(�(�(r#)r6rBrCr�r� parse_content_disposition_headerr�rdrDr�r�r�s@r!r�r��s-����� G� G�H�L�N�
�)��)r#r�c�f��eZdZdZeej�Zed��Z	�fd�Z
ed��Z�xZ
S)�ContentTransferEncodingHeaderrPc��|j|�x|d<}t|�|d<|dj|j�y�Nrmr_r^�r�rSr�rr�s    r!r`z#ContentTransferEncodingHeader.parse��A��*-�*:�*:�5�*A�A��\��Z��j�/��Y���Y����z�5�5�6r#c���t�|�|i|��tj|jj
�|_yr%)r�rdrrbrk�cte�_cter�s   �r!rdz"ContentTransferEncodingHeader.inits0���
���d�!�b�!��O�O�D�$4�$4�$8�$8�9��	r#c��|jSr%)r�r's r!r�z!ContentTransferEncodingHeader.ctes���y�y�r#)r6rBrCr�r�r�&parse_content_transfer_encoding_headerr�r�r`rdrDr�r�r�s@r!r�r��sC����I��� M� M�N�L��7��7�
:����r#r�c�D�eZdZdZeej�Zed��Z	y)�MessageIDHeaderrPc��|j|�x|d<}t|�|d<|dj|j�yr�r�r�s    r!r`zMessageIDHeader.parser�r#N)
r6rBrCr�r�r�parse_message_idr�r�r`rEr#r!rr
s)���I��� 7� 7�8�L��7��7r#r�subject�datezresent-datez	orig-date�senderz
resent-sender�toz	resent-to�ccz	resent-cc�bccz
resent-bcc�fromzresent-fromzreply-tozmime-versionzcontent-type)zcontent-dispositionzcontent-transfer-encodingz
message-idc�.�eZdZ	eedfd�Zd�Zd�Zd�Zy)�HeaderRegistryTc�t�	i|_||_||_|r |jjt�yyr%)�registry�
base_class�
default_class�update�_default_header_map)rrr�use_default_maps    r!r"zHeaderRegistry.__init__6s:��		���
�$���*�����M�M� � �!4�5�r#c�@�	||j|j�<yr%)r
r��rrfres   r!�map_to_typezHeaderRegistry.map_to_typeHs��	�'*��
�
�d�j�j�l�#r#c��|jj|j�|j�}t	d|j
z||jfi�S)N�_)r
�getr�rr�r6rrs   r!�__getitem__zHeaderRegistry.__getitem__NsE���m�m����
�
��d�.@�.@�A���C����$�s�D�O�O�&<�b�A�Ar#c��	||||�Sr%rE)rrfrgs   r!�__call__zHeaderRegistry.__call__Rs��	��t�D�z�$��&�&r#N)	r6rBrCr\r�r"rrrrEr#r!rr2s#��/�",�<N�'+�6�$*�B�
'r#rN)�typesr�emailrrrrrrGrSr\rqr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrEr#r!�<module>rs����
#���0�Y-�Y-�x/3�/3�ha*��a*�H9�2�2��1��
+�+�\�z��
4�4�n�-��
!�-�!�� 3��
"�"�J.�.�:2�/�2�,)�6�)���*	7�	7��
�$<��
�$4���J���$4�	�

�$=���$7�
�	�$7���M��	�$7���M��
�$7���M���$7���M���$7�� �$5�!�"�$5�#�$%=�$A�$3�)��.*'�*'r#

?>