File: //proc/self/root/lib/python3.6/site-packages/docutils/transforms/__pycache__/misc.cpython-36.pyc
3
!e�K � @ sX d Z dZddlmZ ddlmZmZ G dd� de�ZG dd� de�ZG d d
� d
e�Z dS )z
Miscellaneous transforms.
ZreStructuredText� )�nodes)� Transform�TransformErrorc @ s e Zd ZdZdZdd� 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� c C s$ | j }|jd |� |jj|� d S )N�callback)� startnode�details�parent�remove)�self�pending� r
�/usr/lib/python3.6/misc.py�apply s zCallBack.applyN)�__name__�
__module__�__qualname__�__doc__�default_priorityr r
r
r
r r s
r c @ s e Zd ZdZdZdd� ZdS )�ClassAttributez|
Move the "class" attribute specified in the "pending" node into the
immediately following non-comment element.
�� c C s� | j }|j}|}xz|r�xpt|j|�d t|��D ]J}|| }t|tj�s0t|tj�rVq0|d |j d 7 <