Hacked By AnonymousFox

Current Path : /opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/__pycache__/peps.cpython-311.pyc

�

j��fg+���dZdZddlZddlZddlZddlmZmZmZddlm	Z	ddl
mZddl
mZm
Z
mZGd�d	e��ZGd
�de��ZGd�d
e��ZGd�de��ZGd�dej��ZdZdd�ZdS)z�
Transforms for PEP processing.

- `Headers`: Used to transform a PEP's initial RFC-2822 header.  It remains a
  field list, but some entries get processed.
- `Contents`: Auto-inserts a table of contents.
- `PEPZero`: Special processing for PEP 0.
�reStructuredText�N)�nodes�utils�	languages)�	DataError)�	Transform)�parts�
references�miscc�x�eZdZdZdZdZdZejdej	��dfejd��dffZ
d�Zd	S)
�Headersz<
    Process fields in a PEP's initial RFC-2822 header.
    ihzpep-%04dz3http://hg.python.org/peps/file/default/pep-%04d.txtz\$RCSfile: (.+),v \$$z\1z\$[a-zA-Z]+: (.+) \$$c�$�t|j��std���|jd}t|tj��r
d|dvrtd���d}|D�]S}|d������dk�r|d���}	t|��}|j	|z}n�#t$r�|}d}|jj�d|z|�	��}|j�
|��}t	j||pd
|���}|j�
|��}	|�|	��t|d��r|g|dddd�<n$|dxxt	jdd|��z
cc<YnwxYwn��U|�td
���|dkrNt	jt$��}
|j�d|
��|j�|
��t|��dks6|dd������dkrtd���|D�]�}|d������}|d}t|��dkr&td|�d���z���t|��dkrGt|dtj��s&td|�d���z���n�|dkr�	t-jdt-jt3j|jd��d����}
n#t6$rd}
YnwxYw|r.|t	jddt	jd|
|�����z
}n��a|d}|dkrC|D]>}t|tj��r"|�t=|�����?���|dkrD|D]?}t|tj��r#|�t=||�����@���|dvr�g}t	jd��}tAj!d|�����D]j}t|��}|�"t	j|||jj#j$|j%|zz�����|�"|���k|dd�|dd�<���|dkrOtMj'||j(��|r1|���}
t	jd|
|���g|dd�<��|d krO|���}|jj#j$|j%d!zz}t	jd||���g|dd�<��c|d"kr)t|��rtMj'||j(�����dS)#NzDocument tree is empty.r�rfc2822�classeszADocument does not begin with an RFC-2822 header; it is not a PEP.�pep�z?"PEP" header must contain an integer; "%s" is an invalid value.)�	base_nodez(none))�refid�z3Document does not contain an RFC-2822 "PEP" header.��titlez	No title!z4PEP header field body contains multiple elements:
%s)�levelz=PEP header field body may only contain a single paragraph:
%sz
last-modifiedz%d-%b-%Y�source��unknown��refuri�authorzdiscussions-to)�replaceszreplaced-by�requires� z,?\s+���zcontent-type��version))�len�documentr�
isinstancer�
field_list�astext�lower�int�pep_cvs_url�
ValueError�reporter�warning�set_id�problematic�add_backref�	paragraph�pending�PEPZero�insert�note_pending�pformat�time�strftime�	localtime�os�stat�OSError�	reference�replace_self�
mask_email�Text�re�split�append�settings�pep_base_url�pep_urlr�clean_rcs_keywords�rcs_keyword_substitutions)�self�headerr�field�value�cvs_url�msg�msgid�prb�prbidr4�name�body�date�para�node�newbody�space�refpep�pepno�pep_type�uris                      �x/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/peps.py�applyz
Headers.apply(s���4�=�!�!�	7��5�6�6�6���q�!���6�5�#3�4�4�	8���y� 1�1�1��7�8�8�
8����	�	�E��Q�x��� � �&�&�(�(�E�1�1��a����)�)��A��e�*�*�C�"�.��4�G�G��!�A�A�A��C�"�G��-�0�8�8�)�+.�/�:?�9�A�A�C�!�M�0�0��5�5�E��+�E�5�3D�H�27�9�9�9�C� �M�0�0��5�5�E��O�O�E�*�*�*��5��8�}�}�A�*-���a����A�A�A����a����E�O�B��C�$@�$@�@������A������)2�*�;��&�'�'�
'��!�8�8��m�G�,�,�G��M� � ��G�,�,�,��M�&�&�w�/�/�/��v�;�;��?�?�f�Q�i��l�1�1�3�3�9�9�;�;�w�F�F��K�(�(�(��6	O�6	O�E���8�?�?�$�$�*�*�,�,�D���8�D��4�y�y�1�}�}��!0�27�-�-�a�-�2H�2H�!I�J�J�J��T���a���!�$�q�'�5�?�;�;�>�#�%>�&+�m�m�!�m�&<�&<�%=�>�>�>�>���(�(�%��=�"���r�w�t�}�X�/F�'G�'G��'J�K�K�M�M�D�D���%�%�%�$�D�D�D�%�����K��E�O��B����D�� I� I� I�K�K�K�D�����7�D��x��� �<�<�D�!�$���8�8�<��)�)�*�T�*:�*:�;�;�;��<��)�)�)� �A�A�D�!�$���8�8�A��)�)�*�T�3�*?�*?�@�@�@��A��@�@�@����
�3���� �h�x������?�?�*�*�F���K�K�E��N�N�5�?��� $�
� 6� C�"&�,��"6�!7�$9�$9�$9�:�:�:��N�N�5�)�)�)�)�!�#�2�#�,��Q�Q�Q�����(�(��(��t�/M�N�N�N��J��;�;�=�=�D�$��r�4��H�H�H�I�D����G����'�'��;�;�=�=���m�,�9�D�L�2�<M�M�� �?�2�x��D�D�D�E��Q�Q�Q�����"�"�s�4�y�y�"��(��t�/M�N�N�N��m6	O�6	Os&�7C�C"F6�5F6�
A
N�N'�&N'N)�__name__�
__module__�__qualname__�__doc__�default_priorityrHr,rC�compile�
IGNORECASErJr`��r_r
r
s������������G�5�K��2�:�2�B�M�B�B�E�
J��2�:�.�/�/��
7�!:��`O�`O�`O�`O�`Orir
c��eZdZdZdZd�ZdS)�Contentsz~
    Insert an empty table of contents topic and a transform placeholder into
    the document after the RFC 2822 header.
    i|c�L�tj|jjj|jj��}|jd}tjd|��}tj	d|dg���}tj
|��}|j�|��s|d�|��|j�
|��tjtj��}||z
}|j�d|��|j�|��dS)N�contentsr)r�namesr)r�get_languager&rF�
language_coder.�labelsrr�topic�fully_normalize_name�has_namerE�note_implicit_targetr4r	rkr6r7)rK�languagerTrrrr4s      r_r`zContents.apply�s���)�$�-�*@�*N�*.�-�*@�B�B����z�*����B��%�%����B��
�|�<�<�<���)�$�/�/���}�%�%�d�+�+�	(��'�N�!�!�$�'�'�'��
�*�*�5�1�1�1��-���/�/��
�����
���Q��&�&�&��
�"�"�7�+�+�+�+�+riN�rarbrcrdrer`rhrir_rkrk�s5��������
��
,�
,�
,�
,�
,rirkc�"�eZdZdZdZd�Zd�ZdS)�TargetNotesz�
    Locate the "References" section, insert a placeholder for an external
    target footnote insertion transform at the end, and schedule the
    transform to run immediately.
    ic��|j}t|��dz
}dx}}|dkr�t||tj��r�||d���������}d|vr	||}n1d|vr|}|dz}|dkr t||tj����|sntj��}|tjdd��z
}|�	|��|r|�
||��n|�|��tjtj��}|�|��|j�|d��tjt jd|ji���}|�|��|j�|d��dS)	Nrrr
�	copyrightr�
References�callback)�details)r&r%r'r�sectionr)r*rDrr0r6rEr4r
ryr7r�CallBack�cleanup_callback)rK�doc�i�refsectr{�title_wordsr4s       r_r`zTargetNotes.apply�s����m����H�H�q�L��"�"��)��1�f�f��C��F�E�M�:�:�f��a�&��)�*�*�,�,�2�2�4�4�:�:�<�<�K��{�*�*��a�&�����+�+��	�
��F�A��1�f�f��C��F�E�M�:�:�f��		$��m�o�o�G��u�{�2�|�4�4�4�G��J�J�w�����
$��
�
�9�g�.�.�.�.��
�
�7�#�#�#��-�
� 6�7�7�����w�����
�"�"�7�A�.�.�.��-��
�)3�T�5J�(K�M�M�M�����w�����
�"�"�7�A�.�.�.�.�.ric��t|j��dkr&|jj�|j��dSdS)z�
        Remove an empty "References" section.

        Called after the `references.TargetNotes` transform is complete.
        rN)r%�parent�remove)rKr4s  r_r�zTargetNotes.cleanup_callback�sB���w�~���!�#�#��N�!�(�(���8�8�8�8�8�$�#riN)rarbrcrdrer`r�rhrir_ryry�sD����������/�/�/�<9�9�9�9�9riryc��eZdZdZdZd�ZdS)r5z'
    Special processing for PEP 0.
    i�c��t|j��}|j�|��|jj�|j��dS�N)�PEPZeroSpecialr&�walk�	startnoder�r�)rK�visitors  r_r`z
PEPZero.apply�sH�� ���/�/���
���7�#�#�#����$�$�T�^�4�4�4�4�4riNrwrhrir_r5r5�s5����������5�5�5�5�5rir5c�J�eZdZdZejZd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	S)
r�z�
    Perform the special processing needed by PEP 0:

    - Mask email addresses.

    - Link PEP numbers in the second column of 4-column tables to the PEPs
      themselves.
    c��dSr�rh�rKrXs  r_�
unknown_visitzPEPZeroSpecial.unknown_visit�s���ric�J�|�t|����dSr�)r@rAr�s  r_�visit_referencezPEPZeroSpecial.visit_reference�s$�����*�T�*�*�+�+�+�+�+ric�2�d|dvrtj�dS)Nrr)r�SkipNoder�s  r_�visit_field_listzPEPZeroSpecial.visit_field_list�s!����Y��'�'��.� �(�'ric�6�|ddk|_d|_dS)N�cols�r)�	pep_table�entryr�s  r_�visit_tgroupzPEPZeroSpecial.visit_tgroup�s���f���*�����
�
�
ric��|xjdz
c_|jr(|jdkr|d�d��dSdSdS)Nrrr�num)r�r�rEr�s  r_�
visit_colspeczPEPZeroSpecial.visit_colspec�sQ���
�
�a��
�
��>�	*�d�j�A�o�o���O�"�"�5�)�)�)�)�)�	*�	*�o�oric��d|_dS)Nr)r�r�s  r_�	visit_rowzPEPZeroSpecial.visit_rows
����
�
�
ric��|xjdz
c_|jr�|jdkr�t|��dkr�|d�d��|d}t	|t
j��r�t|��dkru|���}	t|��}|j	j
j|j|zz}tj
|||���|d<dS#t$rYdSwxYwdSdSdSdSdS)Nrrrr�rr)r�r�r%rEr'rr3r)r+r&rFrGrHr?r-)rKrX�p�textr�refs      r_�visit_entryzPEPZeroSpecial.visit_entrys���
�
�a��
�
��>�	�d�j�A�o�o�#�d�)�)�q�.�.���O�"�"�5�)�)�)��Q��A��!�U�_�-�-�
�#�a�&�&�A�+�+��x�x�z�z����d�)�)�C��=�1�>�!�\�C�/�0�C� �?�4��c�B�B�B�A�a�D�D�D��!�����D�D�����	�	�o�o�.�.�
�
�+�+s�AC"�"
C0�/C0N)
rarbrcrdr
rHr�r�r�r�r�r�r�rhrir_r�r��s����������o�G�
�
�
�,�,�,�!�!�!����*�*�*�
���
�
�
�
�
rir�)zpeps@python.orgzpython-list@python.orgzpython-dev@python.orgc�f�|�d��r�|d�d��r�|ddd�tvr	|d}n?|����dd��}tjd|d	�
��}|�|S|dxxd|zz
cc<|g|dd�<|S|S)a�
    Mask the email address in `ref` and return a replacement node.

    `ref` is returned unchanged if it contains no email address.

    For email addresses such as "user@host", mask the address as "user at
    host" (text) to thwart simple email address harvesters (except for those
    listed in `non_masked_addresses`).  If a PEP number (`pepno`) is given,
    return a reference including a default email subject.
    rzmailto:rNr�@z&#32;&#97;t&#32;r�html)�formatz?subject=PEP%%20%s)�hasattr�
startswith�non_masked_addressesr)�replacer�raw)r�r\�replacement�replacement_texts    r_rArAs����{�{�8���
��X��!9�!9�)�!D�!D�
��x�=����� 4�4�4��a�&�K�K�"�z�z�|�|�3�3�C�9K�L�L���)�B�(8��H�H�H�K��=�����M�M�M�1�E�9�9�M�M�M�!�]�C����F��J��
rir�)rd�
__docformat__r<rCr9�docutilsrrrr�docutils.transformsrr	r
rr
rkryr5�SparseNodeVisitorr�r�rArhrir_�<module>r�s���
��#�
�	�	�	�	�	�	�	�	�����,�,�,�,�,�,�,�,�,�,�������)�)�)�)�)�)�7�7�7�7�7�7�7�7�7�7�oO�oO�oO�oO�oO�i�oO�oO�oO�d,�,�,�,�,�y�,�,�,�2/9�/9�/9�/9�/9�)�/9�/9�/9�d5�5�5�5�5�i�5�5�5�0�0�0�0�0�U�,�0�0�0�f1��
�����ri

Hacked By AnonymousFox1.0, Coded By AnonymousFox