HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/docutils/transforms/__pycache__/misc.cpython-312.pyc
�

�dd	��f�dZdZddlmZddlmZGd�de�ZGd�de�ZGd	�d
e�Zy)z
Miscellaneous transforms.
�reStructuredText�)�nodes)�	Transformc��eZdZdZdZd�Zy)�CallBacka�
    Inserts a callback into a document.  The callback is called when the
    transform is applied, which is determined by its priority.

    For use with `nodes.pending` elements.  Requires a ``details['callback']``
    entry, a bound method or function which takes one parameter: the pending
    node.  Other data can be stored in the ``details`` attribute or in the
    object hosting the callback method.
    i�c�|�|j}|jd|�|jj|�y)N�callback)�	startnode�details�parent�remove)�self�pendings  �:/usr/lib/python3/dist-packages/docutils/transforms/misc.py�applyzCallBack.applys0���.�.��#����
�#�G�,������g�&�N��__name__�
__module__�__qualname__�__doc__�default_priorityr�rrrrs�����'rrc��eZdZdZdZd�Zy)�ClassAttributez|
    Move the "class" attribute specified in the "pending" node into the
    immediately following non-comment element.
    ��c��|j}|j}|}|r�t|j|�dzt	|��D]r}||}t|tj�st|tj�r�=|dxx|jdz
cc<|jj|�y|}|j}|r��|jjjd|jdzt
j|j|j�|j ��}|j#|�y)N��classes�classz,No suitable element following "%s" directive�	directive��line)r
r�range�index�len�
isinstancer�	Invisible�system_messagerr
�document�reporter�error�
literal_block�	rawsourcer#�replace_self)rrr�childr%�elementr,s       rrzClassAttribute.apply,s���.�.����������v�|�|�E�2�Q�6��F��D�
'�� ��-���w����8�!�'�5�+?�+?�@���	�"�g�o�o�g�&>�>�"����%�%�g�.��
'���������
�
�&�&�,�,�:��o�o�k�*�
+����� 1� 1�7�3D�3D�E����	-���
	���U�#rNrrrrrr#s���
��$rrc� �eZdZdZdZd�Zd�Zy)�Transitionsa�
    Move transitions at the end of sections up the tree.  Complain
    on transitions after a title, at the beginning or end of the
    document, and after another transition.

    For example, transform this::

        <section>
            ...
            <transition>
        <section>
            ...

    into this::

        <section>
            ...
        <transition>
        <section>
            ...
    i>c��|jjtj�D]}|j	|��y)N)r*�findallr�
transition�visit_transition)r�nodes  rrzTransitions.apply`s4���M�M�)�)�%�*:�*:�;�	(�D��!�!�$�'�	(rc��|jj|�}d}|dk(sXt|jdtj�r�|dk(s,t|jdtj
�r�|dk(r�t|jtj�s&t|jtj�sJ�|jjjd|j|j��}nft|j|dz
tj�r<|jjjd|j|j��}|r!|jj||�|dz
}|t|j�ksJ�|t|j�dz
k7ry|}|t|j�dz
k(r�|j}|j�j|jjjd|j��}|jj|jj|�dz|�y|jj|�}|t|j�dz
k(r��|jj|�|jj|dz|�y)	Nrr�z4Document or section may not begin with a transition.)�sourcer#zZAt least one body element must separate transitions; adjacent transitions are not allowed.z'Document may not end with a transition.r")rr%r'r�title�subtitler*�sectionr+r,r;r#r6�insertr&r
)rr8r%r,�siblings     rr7zTransitions.visit_transitionds9�����!�!�$�'�����Q�J��$�+�+�a�.�%�+�+�6��!���t�{�{�1�~�u�~�~�>��a�Z��t�{�{�E�N�N�;�!�$�+�+�u�}�}�=�
?�>��M�M�*�*�0�0�F��{�{����1�4�E�����E�A�I�.��0@�0@�
A��M�M�*�*�0�0�8��{�{����1�4�E���K�K���u�e�,��Q�J�E��s�4�;�;�'�'�'�'��C����$�q�(�(�����s�7�>�>�*�Q�.�.��n�n�G��~�~�%��
�
�.�.�4�4�=����5�$�����"�"�4�;�;�#4�#4�T�#:�Q�#>��F���N�N�(�(��1�E��s�7�>�>�*�Q�.�.�	
�����4� ������e�a�i��.rN)rrrrrrr7rrrr3r3Fs���,��(�,/rr3N)	r�
__docformat__�docutilsr�docutils.transformsrrrr3rrr�<module>rDs>��
�#�
��)�'�y�'�( $�Y� $�FJ/�)�J/r