File: //lib/python3.6/site-packages/docutils/transforms/__pycache__/parts.cpython-36.pyc
3
v2�eE � @ sn d Z dZddlZddlZddlmZmZ ddlmZm Z G dd� de �Z
G dd � d e �ZG d
d� dej�Z
dS )z'
Transforms related to document parts.
ZreStructuredText� N)�nodes�utils)�TransformError� Transformc @ s* e Zd ZdZdZdd� Zf dfdd�ZdS ) �SectNumaS
Automatically assigns numbers to the titles of document sections.
It is possible to limit the maximum section level for which the numbers
are added. For those sections that are auto-numbered, the "autonum"
attribute is set, informing the contents table generator that a different
form of the TOC should be used.
i� c C s� | j jjdd �| _| j jjdd�| _| j jjdd�| _| j jjdd�| _| j jj| j � | j j
jr�| jd krttj
| _| j| j � n0| j| j j
_| j| j j
_| j| j j
_| j| j j
_d S )N�depth�start� �prefix� �suffix)� startnode�details�get�maxdepth�
startvaluer
r �parent�remove�document�settingsZ
sectnum_xform�sys�maxsize�update_section_numbersZ
sectnum_depthZ
sectnum_startZsectnum_prefixZsectnum_suffix)�self� r �/usr/lib/python3.6/parts.py�apply s
z
SectNum.applyr c C s� |d7 }|rd}n| j }x�|D ]�}t|tj�r|t|�f }|d }tjd| jdj|� | j d
dgd�}|j d|� d|d <