AlkantarClanX12

Your IP : 3.147.47.177


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/email/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/email/__pycache__/_parseaddr.cpython-311.pyc

�

c��f�E���dZgd�ZddlZddlZdZdZdZgd�Zgd�Zddddd	d
dd	ddd
ddd
d�Z	d�Z
d�Zd�Zd�Z
d�ZGd�d��ZGd�de��ZdS)zcEmail address parsing code.

Lifted directly from rfc822.py.  This should eventually be rewritten.
)�	mktime_tz�	parsedate�parsedate_tz�quote�N� �z, )�jan�feb�mar�apr�may�jun�jul�aug�sep�oct�nov�dec�january�february�march�aprilr
�june�july�august�	september�october�november�december)�mon�tue�wed�thu�fri�sat�sunip���i���i���i����iD���i��)�UT�UTC�GMT�Z�AST�ADT�EST�EDT�CST�CDT�MST�MDT�PST�PDTc�`�t|��}|sdS|d�d|d<t|��S)zQConvert a date string to a time tuple.

    Accounts for military timezones.
    N�	r)�
_parsedate_tz�tuple)�data�ress  �7/opt/alt/python311/lib64/python3.11/email/_parseaddr.pyrr-s<��
��
�
�C�����
�1�v�~���A����:�:��c
��|sdS|���}|sdS|d�d��s!|d���tvr|d=n7|d�d��}|dkr|d|dzd�|d<t|��dkr;|d�d��}t|��dkr
||dd�z}t|��dkrm|d}|�d��}|d	kr|�d��}|dkr|d|�||d�g|dd�<n|�d
��t|��dkrdS|dd�}|\}}}}}|r|r|sdS|���}|tvr!||���}}|tvrdSt�	|��dz}|dkr|dz}|d	dkr
|dd	�}|�d
��}|dkr||}}|d	dkr|dd	�}|sdS|d�
��s||}}|d	dkr
|dd	�}|�d
��}t|��dkr|\}	}
d}n�t|��dkr|\}	}
}nqt|��dkr\d|dvrR|d�d��}t|��dkr|\}	}
d}nt|��dkr|\}	}
}ndSdS	t|��}t|��}t|	��}	t|
��}
t|��}n#t$rYdSwxYw|dkr|dkr|dz
}n|dz
}d}|�
��}|tvrt|}n>	t|��}n#t$rYnwxYw|dkr|�d��rd}|r"|dkrd	}
|}nd}
|
|dzdz|dzdzzz}||||	|
|ddd	|g
S)a�Convert date to extended time tuple.

    The last (additional) element is the time zone offset in seconds, except if
    the timezone was specified as -0000.  In that case the last element is
    None.  This indicates a UTC timestamp that explicitly declaims knowledge of
    the source timezone, as opposed to a +0000 timestamp that indicates the
    source timezone really was UTC.

    Nr�,���-��+���r���:��0�.�d�Dili�i�<)�split�endswith�lower�	_daynames�rfind�len�find�append�_monthnames�index�isdigit�int�
ValueError�upper�
_timezones�
startswith)r9�i�stuff�s�dd�mm�yy�tm�tz�thh�tmm�tss�tzoffset�tzsigns              r;r7r79s������t��:�:�<�<�D����t��A�w������$��Q��
�
���9� <� <���G�G���G�M�M�#������6�6��1�g�a��c�d�d�m�D��G�
�4�y�y�A�~�~��Q��
�
�c�"�"���u�:�:��?�?��4����8�#�D�
�4�y�y�A�~�~���G��
�F�F�3�K�K����7�7����s���A��q�5�5��"�1�"��q����u�~�D����H�H��K�K��O�O�O�
�4�y�y�1�}�}��t�����8�D���R��R��R���2��"���t�	�����B�	�����R�X�X�Z�Z�B��
�[� � ��4�	�	�	�2�	�	��	"�B�	�B�w�w�
�b���	�"�v��}�}�
����W��
������A��1�u�u��R�B��	�"�v��}�}�
����W���	��4�
�a�5�=�=�?�?���R�B��	�"�v��}�}�
����W��	���#���B�
�2�w�w�!�|�|��
��c����	�R���A������c�3�3�	�R���A���#��A��,�,�
��U�[�[��
�
���r�7�7�a�<�<��J�S�#��C�C�
��W�W��\�\� �O�S�#�s�s��4��t��
��W�W��
��W�W���#�h�h���#�h�h���#�h�h���������t�t�����
�C�x�x�
��7�7��$�J�B�B�
�$�J�B��H�	�����B�	�Z����b�>���	��2�w�w�H�H���	�	�	��D�	�����Q�;�;�2�=�=��-�-�;��H��J��a�<�<��F� �y�H�H��F��x��}�d�2�h��n�b�5H�H�I����B��S�#�q�!�R��:�:s%�6AN�
N�N�O(�(
O5�4O5c�b�t|��}t|t��r
|dd�S|S)z&Convert a time string to a time tuple.Nr6)r�
isinstancer8�r9�ts  r;rr�s3���T���A��!�U������!��u���r<c��|d�tj|dd�dz��Stj|��}||dz
S)zETurn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp.r6N�)rD)�time�mktime�calendar�timegmrms  r;rr�sE���A�w���{�4����8�e�+�,�,�,��O�D�!�!���4��7�{�r<c�V�|�dd���dd��S)z�Prepare string to be used in a quoted string.

    Turns backslash and double quote characters into quoted pairs.  These
    are the only characters that need to be quoted inside a quoted string.
    Does not add the surrounding double quotes.
    �\z\\�"z\")�replace)�strs r;rr�s(���;�;�t�V�$�$�,�,�S�%�8�8�8r<c�d�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
dd
�Zd�Zd�Z
d
�Zdd�Zd�ZdS)�
AddrlistClassaAddress parser class by Ben Escoto.

    To understand what this class does, it helps to have a copy of RFC 2822 in
    front of you.

    Note: this class interface is deprecated and may be removed in the future.
    Use email.utils.AddressList instead.
    c��d|_d|_d|_d|_|j|jz|_|j|jz|jz|_|j�dd��|_||_g|_	dS)z�Initialize a new instance.

        `field' is an unparsed address header field, containing
        one or more addresses.
        z()<>@,:;."[]rz 	z
rJrN)
�specials�pos�LWS�CR�FWS�atomendsrx�
phraseends�field�commentlist��selfr�s  r;�__init__zAddrlistClass.__init__�sw��(��
�����������8�d�g�%����
���0�4�7�:��
��-�/�/��R�8�8�����
�����r<c��g}|jt|j��kr�|j|j|jdzvrJ|j|jdvr%|�|j|j��|xjdz
c_nD|j|jdkr-|j�|�����nn|jt|j��k��t�|��S)z&Skip white space and extract comments.z

r?�()	r~rSr�rrUr��
getcomment�EMPTYSTRING�join)r��wslists  r;�gotonextzAddrlistClass.gotonext�s������h��T�Z���(�(��z�$�(�#�t�x�&�'8�8�8��:�d�h�'�v�5�5��M�M�$�*�T�X�"6�7�7�7����A�
������D�H�%��,�,�� �'�'����(9�(9�:�:�:�:���h��T�Z���(�(�����'�'�'r<c���g}|jt|j��krN|���}|r||z
}n|�d��|jt|j��k�N|S)zVParse all addresses.

        Returns a list containing all of the addresses.
        )rr)r~rSr��
getaddressrU)r��result�ads   r;�getaddrlistzAddrlistClass.getaddrlist�sp��
���h��T�Z���(�(����"�"�B��
(��"�����
�
�h�'�'�'��h��T�Z���(�(��
r<c��g|_|���|j}|j}|���}|���g}|jt	|j��kr,|r(t�|j��|dfg}�n|j|jdvrF||_||_|���}t�|j��|fg}�n�|j|jdkr�g}t	|j��}|xjdz
c_|jt	|j��krz|���|j|kr'|j|jdkr|xjdz
c_n4||�	��z}|jt	|j��k�zn�|j|jdkrx|�
��}|jr?t�|��dzd�|j��zd	z|fg}nrt�|��|fg}nT|r)t�|j��|dfg}n)|j|j|jvr|xjdz
c_|���|jt	|j��kr&|j|jd
kr|xjdz
c_|S)zParse the next address.rz.@rGr?�;�<z (r�)r>)r�r�r~�
getphraselistrSr��SPACEr��getaddrspecr��getrouteaddrr})r��oldpos�oldcl�plist�
returnlist�addrspec�fieldlen�	routeaddrs        r;r�zAddrlistClass.getaddresss�������
�
�������� ���"�"�$�$���
�
�����
��8�s�4�:���&�&��
H�$�z�z�$�*:�;�;�U�1�X�F�G�
��
�Z���
!�T�
)�
)��D�H�$�D���'�'�)�)�H� �:�:�d�&6�7�7��B�C�J�J�
�Z���
!�S�
(�
(��J��4�:���H��H�H��M�H�H��(�S���_�_�,�,��
�
�����8�h�&�&�4�:�d�h�+?�3�+F�+F��H�H��M�H�H��'�$�/�/�*;�*;�;�
��(�S���_�_�,�,���Z���
!�S�
(�
(��)�)�+�+�I���
>�$�z�z�%�0�0�4�7�"�x�x��(8�9�9� :�<?� @�AJ�L�M�
�
� %�z�z�%�0�0�)�<�=�
�
��
�$�z�z�$�*:�;�;�U�1�X�F�G�
�
���D�H�%���6�6����A�
����
�
�����8�c�$�*�o�o�%�%�$�*�T�X�*>�#�*E�*E��H�H��M�H�H��r<c��|j|jdkrdSd}|xjdz
c_|���d}|jt|j��kr�|r|���d}n�|j|jdkr|xjdz
c_n�|j|jdkr|xjdz
c_d}nL|j|jd	kr|xjdz
c_n%|���}|xjdz
c_n1|���|jt|j��k��|S)
z�Parse a route address (Return-path value).

        This method just skips all the route stuff and returns the addrspec.
        r�NFr?r�>�@TrG)r�r~r�rS�	getdomainr�)r��expectroute�adlists   r;r�zAddrlistClass.getrouteaddrGs:��
�:�d�h��3�&�&��F������A�
����
�
�������h��T�Z���(�(��
���� � � �#�����D�H�%��,�,����A�
������D�H�%��,�,����A�
���"�����D�H�%��,�,����A�
�����)�)�+�+�����A�
�����M�M�O�O�O�!�h��T�Z���(�(�$�
r<c���g}|���|jt|j��k�rzd}|j|jdkrX|r.|d���s|���|�d��|xjdz
c_d}n�|j|jdkr8|�dt|�����z��nq|j|j|j	vr1|r.|d���s|���nr|�|�
����|���}|r|r|�|��|jt|j��k��z|jt|j��ks|j|jdkrt�|��S|�d��|xjdz
c_|���|�
��}|stSt�|��|zS)	zParse an RFC 2822 addr-spec.TrJrDr?Frwz"%s"r�)r�r~rSr��strip�poprUr�getquoter��getatomr�r�r�)r��aslist�preserve_ws�ws�domains     r;r�zAddrlistClass.getaddrspecgs�����
�
�����h��T�Z���(�(��K��z�$�(�#�s�*�*��!�&��*�"2�"2�"4�"4�!��J�J�L�L�L��
�
�c�"�"�"����A�
���#�����D�H�%��,�,��
�
�f�u�T�]�]�_�_�'=�'=�=�>�>�>�>���D�H�%���6�6��!�&��*�"2�"2�"4�"4�!��J�J�L�L�L���
�
�d�l�l�n�n�-�-�-������B��
"�r�
"��
�
�b�!�!�!�%�h��T�Z���(�(�(�8�s�4�:���&�&�$�*�T�X�*>�#�*E�*E��#�#�F�+�+�+��
�
�c�������A�
����
�
�������!�!���	�������'�'�&�0�0r<c�>�g}|jt|j��k�rd|j|j|jvr|xjdz
c_�n|j|jdkr-|j�|�����n�|j|jdkr(|�|�����n�|j|jdkr&|xjdz
c_|�d��n^|j|jdkrtS|j|j|j	vrnE|�|�
����|jt|j��k��dt�|��S)z-Get the complete domain name from an address.r?r��[rJr�)r~rSr�rr�rUr��getdomainliteralr�r�r�r�)r��sdlists  r;r�zAddrlistClass.getdomain�sd�����h��T�Z���(�(��z�$�(�#�t�x�/�/����A�
������D�H�%��,�,�� �'�'����(9�(9�:�:�:�:���D�H�%��,�,��
�
�d�3�3�5�5�6�6�6�6���D�H�%��,�,����A�
����
�
�c�"�"�"�"���D�H�%��,�,�#�"���D�H�%���6�6���
�
�d�l�l�n�n�-�-�-�#�h��T�Z���(�(�$����'�'�'r<Tc��|j|j|krdSdg}d}|xjdz
c_|jt|j��kr�|r(|�|j|j��d}n�|j|j|vr|xjdz
c_n�|r>|j|jdkr(|�|�������|j|jdkrd}n%|�|j|j��|xjdz
c_|jt|j��k��t
�|��S)a�Parse a header fragment delimited by special characters.

        `beginchar' is the start character for the fragment.
        If self is not looking at an instance of `beginchar' then
        getdelimited returns the empty string.

        `endchars' is a sequence of allowable end-delimiting characters.
        Parsing stops when one of these is encountered.

        If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
        within the parsed fragment.
        rFr?r�rvT)r�r~rSrUr�r�r�)r��	beginchar�endchars�
allowcomments�slistrs      r;�getdelimitedzAddrlistClass.getdelimited�sI���:�d�h��9�,�,��2���������A�
����h��T�Z���(�(��
3����T�Z���1�2�2�2������D�H�%��1�1����A�
�����
3�4�:�d�h�#7�3�#>�#>����T�_�_�.�.�/�/�/����D�H�%��-�-�������T�Z���1�2�2�2��H�H��M�H�H��h��T�Z���(�(� ����&�&�&r<c�0�|�ddd��S)z1Get a quote-delimited fragment from self's field.rwz"
F�r��r�s r;r�zAddrlistClass.getquote�s��� � ��e�U�3�3�3r<c�0�|�ddd��S)z7Get a parenthesis-delimited fragment from self's field.r�z)
Tr�r�s r;r�zAddrlistClass.getcomment�s��� � ��e�T�2�2�2r<c�6�d|�ddd��zS)z!Parse an RFC 2822 domain-literal.z[%s]r�z]
Fr�r�s r;r�zAddrlistClass.getdomainliteral�s����)�)�#�u�e�<�<�<�<r<Nc�V�dg}|�|j}|jt|j��krg|j|j|vrnR|�|j|j��|xjdz
c_|jt|j��k�gt
�|��S)aParse an RFC 2822 atom.

        Optional atomends specifies a different set of end token delimiters
        (the default is to use self.atomends).  This is used e.g. in
        getphraselist() since phrase endings must not include the `.' (which
        is legal in phrases).rNr?)r�r~rSr�rUr�r�)r�r��atomlists   r;r�zAddrlistClass.getatom�s����4�����}�H��h��T�Z���(�(��z�$�(�#�x�/�/������
�4�8� 4�5�5�5��H�H��M�H�H��h��T�Z���(�(�����)�)�)r<c�f�g}|jt|j��k�r|j|j|jvr|xjdz
c_n�|j|jdkr(|�|�����n�|j|jdkr-|j�|�����nG|j|j|jvrnK|�|�	|j����|jt|j��k��|S)z�Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.
        r?rwr�)
r~rSr�r�rUr�r�r�r�r�)r�r�s  r;r�zAddrlistClass.getphraselist�s�����h��T�Z���(�(��z�$�(�#�t�x�/�/����A�
������D�H�%��,�,����T�]�]�_�_�-�-�-�-���D�H�%��,�,�� �'�'����(9�(9�:�:�:�:���D�H�%���8�8�����T�\�\�$�/�:�:�;�;�;��h��T�Z���(�(��r<)T�N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r��r<r;r{r{�s������������&(�(�(����9�9�9�v���@$1�$1�$1�L(�(�(�.#'�#'�#'�#'�J4�4�4�3�3�3�=�=�=�*�*�*�*�(����r<r{c�<�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	S)
�AddressListz@An AddressList encapsulates a list of parsed RFC 2822 addresses.c��t�||��|r|���|_dSg|_dSr�)r{r�r��addresslistr�s  r;r�zAddressList.__init__sH�����t�U�+�+�+��	"�#�/�/�1�1�D����!�D���r<c�*�t|j��Sr�)rSr�r�s r;�__len__zAddressList.__len__	s���4�#�$�$�$r<c��td��}|jdd�|_|jD]%}||jvr|j�|���&|Sr��r�r�rU�r��other�newaddr�xs    r;�__add__zAddressList.__add__s`���d�#�#��"�.�q�q�q�1����"�	.�	.�A���(�(�(��#�*�*�1�-�-�-���r<c�`�|jD]%}||jvr|j�|���&|Sr�)r�rU�r�r�r�s   r;�__iadd__zAddressList.__iadd__s?���"�	+�	+�A���(�(�(�� �'�'��*�*�*���r<c�~�td��}|jD]%}||jvr|j�|���&|Sr�r�r�s    r;�__sub__zAddressList.__sub__sL���d�#�#���!�	.�	.�A���)�)�)��#�*�*�1�-�-�-���r<c�`�|jD]%}||jvr|j�|���&|Sr�)r��remover�s   r;�__isub__zAddressList.__isub__$s?���"�	+�	+�A��D�$�$�$�� �'�'��*�*�*���r<c��|j|Sr�)r�)r�rWs  r;�__getitem__zAddressList.__getitem__+s�����&�&r<N)r�r�r�r�r�r�r�r�r�r�r�r�r<r;r�r�s�������J�J�"�"�"�%�%�%�������������'�'�'�'�'r<r�)r��__all__rqrsr�r��
COMMASPACErVrQr\rr7rrrr{r�r�r<r;�<module>r�sN����
����������������
�
�I�I�I��

>�=�=�	��A�Q�A��$��$��$��$��$���
�
�
�
�z;�z;�z;�z������9�9�9�k�k�k�k�k�k�k�k�Z	-'�-'�-'�-'�-'�-�-'�-'�-'�-'�-'r<