HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/self/root/lib/python3.6/site-packages/docutils/transforms/__pycache__/misc.cpython-36.pyc
3

!e�K�@sXdZdZddlmZddlmZmZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	dS)z
Miscellaneous transforms.
ZreStructuredText�)�nodes)�	Transform�TransformErrorc@seZdZdZdZdd�ZdS)�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�cCs$|j}|jd|�|jj|�dS)N�callback)�	startnode�details�parent�remove)�self�pending�r
�/usr/lib/python3.6/misc.py�applyszCallBack.applyN)�__name__�
__module__�__qualname__�__doc__�default_priorityrr
r
r
rrs
rc@seZdZdZdZdd�ZdS)�ClassAttributez|
    Move the "class" attribute specified in the "pending" node into the
    immediately following non-comment element.
    ��cCs�|j}|j}|}xz|r�xpt|j|�dt|��D]J}||}t|tj�s0t|tj�rVq0|d|j	d7<|jj
|�dSW|}|j}qW|jjj
d|j	dtj|j|j�|jd�}|j|�dS)N��classes�classz,No suitable element following "%s" directiveZ	directive)�line)rr	�range�index�len�
isinstancerZ	InvisibleZsystem_messagerr
�document�reporter�errorZ
literal_blockZ	rawsourcerZreplace_self)rrr	Zchildr�elementr!r
r
rr,s(


zClassAttribute.applyN)rrrrrrr
r
r
rr#src@s$eZdZdZdZdd�Zdd�ZdS)�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>cCs&x |jjtj�D]}|j|�qWdS)N)rZtraverser�
transition�visit_transition)r�noder
r
rr`szTransitions.applycCs�|jj|�}d}|dksLt|jdtj�r�|dksLt|jdtj�r�|dkr�t|jtj�slt|jtj�slt�|jj	j
d|j|jd�}n.t|j|dtj
�r�|jj	j
d|j|jd�}|r�|jj||�|d7}|t|j�ks�t�|t|j�dkr�dS|}xh|t|j�dk�rb|j}|jdk�rT|jj	j
d|jd�}|jj|jj|�d|�dS|jj|�}q�W|jj|�|jj|d|�dS)	Nrr�z4Document or section may not begin with a transition.)�sourcerzZAt least one body element must separate transitions; adjacent transitions are not allowed.z'Document may not end with a transition.)r)r	rrr�titleZsubtitlerZsection�AssertionErrorr r!r(rr$�insertrr
)rr&rr!Zsiblingr
r
rr%dsD
zTransitions.visit_transitionN)rrrrrrr%r
r
r
rr#Fsr#N)
rZ
__docformat__ZdocutilsrZdocutils.transformsrrrrr#r
r
r
r�<module>s#