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__/universal.cpython-311.pyc

�

j��f1��&�dZdZddlZddlZddlmZmZddlmZddl	m
Z
Gd�de��ZGd	�d
e��ZGd�de��Z
Gd
�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZdS)a�
Transforms needed by most or all documents:

- `Decorations`: Generate a document's header & footer.
- `ExposeInternals`: Expose internal attributes.
- `Messages`: Placement of system messages generated after parsing.
- `FilterMessages`: Remove system messages below verbosity threshold.
- `TestMessages`: Like `Messages`, used on test runs.
- `StripComments`: Remove comment elements from the document tree.
- `StripClassesAndElements`: Remove elements with classes
  in `self.document.settings.strip_elements_with_classes`
  and class values in `self.document.settings.strip_classes`.
- `SmartQuotes`: Replace ASCII quotation marks with typographic form.
�reStructuredText�N)�nodes�utils)�	Transform)�smartquotesc�(�eZdZdZdZd�Zd�Zd�ZdS)�DecorationszD
    Populate a document's decoration element (header, footer).
    i4c�j�|���}|rB|j���}|���}|�|��|���}|rD|j���}|���}|�|��dSdS�N)�generate_header�document�get_decoration�
get_header�extend�generate_footer�
get_footer)�self�header_nodes�
decoration�header�footer_nodes�footers      �}/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/universal.py�applyzDecorations.apply&s����+�+�-�-���	(���5�5�7�7�J��*�*�,�,�F��M�M�,�'�'�'��+�+�-�-���	(���5�5�7�7�J��*�*�,�,�F��M�M�,�'�'�'�'�'�	(�	(�c��dSr�)rs rrzDecorations.generate_header2s���trc
�F�|jj}|js|js|js|j�rwg}|jr|js|jrl|jr|j}ntj|j	|j��}|�
tjdd|���tj
d��g��|jrXtj|jtj����}|�tj
d|zdz����|jrz|�
tj
d��tjddd���tj
d	��tjdd
d���tj
d��g��tjddg|�R�gSdS)
N�zView document source)�refuriz.
zGenerated on: z
Generated by �Docutilsz https://docutils.sourceforge.io/z from rz(https://docutils.sourceforge.io/rst.htmlz	 source.
)r
�settings�	generator�	datestamp�source_link�
source_url�_sourcer�
relative_path�_destinationrr�	reference�Text�time�strftime�gmtime�append�	paragraph)rr"�text�sourcer$s     rrzDecorations.generate_footer5s����=�)����	�(�"4�	��#�	�'/�':�	��D��$�

(��)9�

(��&�

(��&�C�%�0�F�F�"�0��1F�19�1A�C�C�F�����O�B�(>�+1�3�3�3��J�u�%�%�'�(�(�(��!�
N� �M�(�*<�d�k�m�m�L�L�	����E�J�'7�)�'C�e�'K�L�L�M�M�M��!�	
/�����J��/�/��O�B�
�+M�O�O�O��J�x�(�(��O�B�(:�,/�0�0�0��J�|�,�,�.�/�/�/��O�B��2�T�2�2�2�3�3��4rN)�__name__�
__module__�__qualname__�__doc__�default_priorityrrrrrrr	r	sS����������
(�
(�
(����%�%�%�%�%rr	c�"�eZdZdZdZd�Zd�ZdS)�ExposeInternalszL
    Expose internal attributes if ``expose_internals`` setting is set.
    iHc�8�t|tj��Sr)�
isinstancerr+�r�nodes  r�not_TextzExposeInternals.not_Textes���d�E�J�/�/�/�/rc���|jjjrQ|j�|j��D]3}|jjjD]}t||d��}|�||d|z<��2dSdS)Nz	internal:)r
r"�expose_internals�findallr>�getattr)rr=�att�values    rrzExposeInternals.applyhs����=�!�2�	8��
�-�-�d�m�<�<�
8�
8���=�1�B�8�8�C�#�D�#�t�4�4�E��(�27��[�3�.�/��8�	8�	8�
8�
8rN)r3r4r5r6r7r>rrrrr9r9]sD����������0�0�0�8�8�8�8�8rr9c��eZdZdZdZd�ZdS)�Messageszi
    Place any system messages generated after parsing into a dedicated section
    of the document.
    i\c���|jj}d�|D��}|rVtjdg���}|tjdd��z
}||z
}g|jjdd�<|xj|z
c_dSdS)Nc� �g|]}|j�	|��Sr)�parent)�.0�msgs  r�
<listcomp>z"Messages.apply.<locals>.<listcomp>|s��D�D�D�#���D�#�D�D�Dr�system-messages)�classesrzDocutils System Messages)r
�transform_messagesr�section�title)r�messages�loose_messagesrPs    rrzMessages.applyzs����=�3��D�D��D�D�D���	%��m�->�,?�@�@�@�G��u�{�2�'A�B�B�B�G��~�%�G�24�D�M�,�Q�Q�Q�/��M�M�W�$�M�M�M�M�
	%�	%rN�r3r4r5r6r7rrrrrFrFqs5��������
��	%�	%�	%�	%�	%rrFc��eZdZdZdZd�ZdS)�FilterMessagesz�
    Remove system messages below verbosity threshold.

    Convert <problematic> nodes referencing removed messages to <Text>.
    Remove "System Messages" section if empty.
    ifc��t|j�tj����D]b}|d|jjjkrE|j�|��	|jj	|dd=�R#t$rY�^wxYw�ct|j�tj����D]U}|d|jj	vr?|j�|tj
|��������V|j�tj��D]9}d|dvr-t!|��dkr|j�|���:dS)N�level�idsr�refidrMrN�)�tupler
rAr�system_message�reporter�report_levelrI�removerY�
IndexError�problematic�replacer+�astextrP�lenr<s  rrzFilterMessages.apply�sh���$�-�/�/��0D�E�E�F�F�	�	�D��G�}�t�}�5�B�B�B���"�"�4�(�(�(���
�)�$�u�+�a�.�9�9��"�����D�����	C��$�-�/�/��0A�B�B�C�C�	E�	E�D��G�}�D�M�$5�5�5���#�#�D�%�*�T�[�[�]�]�*C�*C�D�D�D���M�)�)�%�-�8�8�	)�	)�D� �D��O�3�3��D�	�	�Q�����"�"�4�(�(�(��	)�	)s�*B�
B�BNrTrrrrVrV�s5����������
)�
)�
)�
)�
)rrVc� �eZdZdZdZdZd�ZdS)�TestMessageszk
    Append all post-parse system messages to the end of the document.

    Used for testing purposes.
    Fipc�R�|jjD]}|js|xj|z
c_�dSr)r
rOrI)rrKs  rrzTestMessages.apply�s;���=�3�	%�	%�C��:�
%��
�
��$�
�
��	%�	%rN)r3r4r5r6�__test__r7rrrrrgrg�s:���������H���%�%�%�%�%rrgc��eZdZdZdZd�ZdS)�
StripCommentszq
    Remove comment elements from the document tree (only if the
    ``strip_comments`` setting is enabled).
    i�c���|jjjrNt|j�t
j����D]}|j�|���dSdSr)	r
r"�strip_commentsr\rAr�commentrIr`r<s  rrzStripComments.apply�sh���=�!�0�	)��d�m�3�3�E�M�B�B�C�C�
)�
)����"�"�4�(�(�(�(�	)�	)�
)�
)rNrTrrrrkrk�s5��������
��)�)�)�)�)rrkc�"�eZdZdZdZd�Zd�ZdS)�StripClassesAndElementsz�
    Remove from the document tree all elements with classes in
    `self.document.settings.strip_elements_with_classes` and all "classes"
    attribute values in `self.document.settings.strip_classes`.
    i�c���|jjjrah|jjj�|_t	|j�|j����D]}|j�|���|jjj	sdS|jjj	}|j�tj��D]3}|D].}	|d�|���#t$rY�+wxYw�4dS)NrN)
r
r"�strip_elements_with_classes�strip_elementsr\rA�
check_classesrIr`�
strip_classesr�Element�
ValueError)rr=ru�class_values    rrzStripClassesAndElements.apply�s���=�!�=�	)�#A�D�M�$:�$?�#A�D���d�m�3�3�D�4F�G�G�H�H�
)�
)����"�"�4�(�(�(�(��}�%�3�	��F��
�.�<�
��M�)�)�%�-�8�8�	�	�D�,�
�
�����O�*�*�;�7�7�7�7��!�����D�����
�	�	s�C�
C+�*C+c�|�t|tj��sdS|ddd�D]}||jvrdS�dS)NFrNT)r;rrvrs)rr=rxs   rrtz%StripClassesAndElements.check_classes�sV���$��
�.�.�	��5��	�?�1�1�1�-�	�	�K��d�1�1�1��t�t�2��urN)r3r4r5r6r7rrtrrrrprp�sD�������������&����rrpc��eZdZdZdZejejfZ	ejejej	ej
ejejej
fZ	dZ	d�Zd�Zd�ZdS)�SmartQuotesz�
    Replace ASCII quotation marks with typographic form.

    Also replace multiple dashes with em-dash/en-dash characters.
    iW�qDec�Z�tj|||���t��|_dS)N)�	startnode)r�__init__�set�unsupported_languages)rr
r~s   rrzSmartQuotes.__init__s,����4��Y�?�?�?�?�%(�U�U��"�"�"rc#�K�|D]x}t|j|j��st|jj|j��rdt|��fV��Ot	jddt|����}d|fV��ydS)N�literalz(?<=)([-\'".`])z\\\1�plain)r;rI�
literal_nodes�str�re�sub)r�txtnodesr=�txts    r�
get_tokenszSmartQuotes.get_tokenss������	#�	#�D��4�;��(:�;�;�
#��d�k�0�$�2D�E�E�
#���T���*�*�*�*�*��f�4�g�s�4�y�y�I�I���s�l�"�"�"�"�	#�	#rc���|jj�dd��}|sdS	|�d��}n#t$rd}YnwxYw|jjj}|jjj}|r1tjj	�
t|����|j�tj��D�]�}t||j��r�t|jtj��r�9d�|�tj��D��}|�|��}|r d|vr|�dd��}n|dz
}t+j|��D]}|tjj	vr|}nJ�||jvr$|jj�d|z|���|j�|��d}tj|�|��|j|�	��}	t=||	��D]2\}
}|
j�|
tj|�����3���|j���dS)
N�smart_quotesF�altc�P�g|]#}t|jtj���!|��$Sr)r;rIr�
option_string)rJ�txtnodes  rrLz%SmartQuotes.apply.<locals>.<listcomp>3sG��@�@�@�G�)�'�.�*/�*=� ?� ?�@��@�@�@rz
-x-altquotrz*No smart quotes defined for language "%s".)�	base_node)�attr�language) r
r"�
setdefault�
startswith�AttributeError�
language_code�smartquotes_localesr�
smartchars�quotes�update�dictrAr�TextElementr;�
nodes_to_skiprIr+�get_language_codercr�normalize_language_tagr�r^�warning�add�educate_tokensr��smartquotes_action�zip�clear)rr��alternative�document_language�lc_smartquotesr=r��lang�tag�teacherr��newtexts            rrzSmartQuotes.applys����}�-�8�8��9>�@�@���	��F�	 �&�1�1�%�8�8�K�K���	 �	 �	 ��K�K�K�	 ����!�M�2�@����/�C���	G��"�)�0�0��n�1E�1E�F�F�F��M�)�)�%�*;�<�<�)	E�)	E�D��$�� 2�3�3�
���$�+�u�'8�9�9�
��@�@�t�|�|�E�J�/G�/G�@�@�@�H�
�)�)�*;�<�<�D��
)��4�'�'��<�<��b�9�9�D�D��L�(�D��3�D�9�9�

�

���+�0�7�7�7��D��E�8��t�9�9�9��M�*�2�2�D�t�K�"&�3�(�(�(��*�.�.�t�4�4�4���"�0�����)�)��,�t�=�=�=�G�%(��'�$:�$:�
E�
E� �����&�&�w��
�7�0C�0C�D�D�D�D�
E�	
�"�(�(�*�*�*�*�*s�<�A�
AN)r3r4r5r6r7r�FixedTextElement�Specialr��imager��math�rawrbr�r�rr�rrrrr{r{�s������������+�U�]�;�M�M��+�U�]��[�%�-����Y�� 1�3�M�G����+�+�+�#�#�#�<+�<+�<+�<+�<+rr{)r6�
__docformat__r�r,�docutilsrr�docutils.transformsr�docutils.utilsrr	r9rFrVrgrkrpr{rrr�<module>r�s���
�
�#�
�	�	�	�	�����!�!�!�!�!�!�!�!�)�)�)�)�)�)�&�&�&�&�&�&�<�<�<�<�<�)�<�<�<�~8�8�8�8�8�i�8�8�8�(%�%�%�%�%�y�%�%�%�6)�)�)�)�)�Y�)�)�)�6%�%�%�%�%�9�%�%�%�&)�)�)�)�)�I�)�)�)�#�#�#�#�#�i�#�#�#�Lf+�f+�f+�f+�f+�)�f+�f+�f+�f+�f+r

Hacked By AnonymousFox1.0, Coded By AnonymousFox