HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/directives/__pycache__/patches.cpython-310.pyc
o

�$�aH#�@sdZddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZddl
mZmZmZddlmZddlmZmZdd	lmZdd
lmZddlmZddlmZdd
lmZddl m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)m*Z*m+Z+ddl,m-Z-zddl
m.Z/ddl0m1Z2Wne3y�ddl4m1Z2ddl4m5Z5e5j.Z/Ynwer�ddl6m7Z7e#�8e9�Z:Gdd�dej;�Z;Gdd�de2e%�Z1Gdd�dej<�Z<Gdd�dej=�Z=Gd d!�d!ej>�Z>Gd"d#�d#e%�Z?Gd$d%�d%e%�Z@d&d'd(eeAeffd)d*�ZBdS)+z�
    sphinx.directives.patches
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�
TYPE_CHECKING�Any�Dict�List�Tuple�cast)�nodes)�Node�make_id�system_message)�
directives)�images�tables)�set_classes)�addnodes)�RemovedInSphinx60Warning)�optional_int)�
MathDomain)�__)�logging)�SphinxDirective)�set_source_info)�SEP�os_path�relpath)�
OptionSpec)�meta)�Meta)�MetaBody)�Sphinxc�*eZdZdZdeef�fdd�Z�ZS)�FigureziThe figure directive which applies `:name:` option to the figure node
    instead of the image node.
    �returncs�|j�dd�}t���}t|�dkst|dtj�r|St|�dks$J�ttj	|d�}|r8||jd<|�
|�|jdurOt|�dkrOttj|d�}|j|_|gS)N�name�r�)
�options�pop�super�run�len�
isinstancer	rr�figure�add_name�line�caption)�selfr$�result�figure_noder0��	__class__��;/usr/lib/python3/dist-packages/sphinx/directives/patches.pyr*4s


z
Figure.run��__name__�
__module__�__qualname__�__doc__rr
r*�
__classcell__r6r6r4r7r"/�r"cs&eZdZdeef�fdd�Z�ZS)rr#csrt���}|D]/}t|tj�r6t|jddt�r6|jdd}|j�|jj	�|_
|j|_|d|_
tj|_q|S)Nr	r�content)r)r*r,r	�pending�details�	meta_node�env�doc2path�docname�source�linenor/�
rawcontentrrr5)r1r2�noderr4r6r7r*Js
�
�zMeta.run)r9r:r;rr
r*r=r6r6r4r7rIsrc�JeZdZdZdeef�fdd�Zdeej	ee
ff�fdd�Z�ZS)�RSTTablezxThe table directive which sets source and line information to its caption.

    Only for docutils-0.13 or older version.r#c�t�dt�t���S)NzRSTTable is deprecated.��warnings�warnrr)r*�r1r4r6r7r*_��
zRSTTable.runc�$t���\}}|rt||�||fS�N�r)�
make_titler�r1�title�messager4r6r7rUd�
zRSTTable.make_title�
r9r:r;r<rr
r*rr	rWrrUr=r6r6r4r7rKZ�(rKcr!)�CSVTablez�The csv-table directive which searches a CSV file from Sphinx project's source
    directory when an absolute path is given via :file: option.
    r#cs�d|jvrO|jd�ttjf�rO|jjjj}|jd}t	�
|�r.tjt
d�|j|jfd�n!t	�|jt|jddd���}t	�|�|j��}t||�|jd<t���S)N�filez�":file:" option for csv-table directive now recognizes an absolute path as a relative path from source directory. Please update your document.��locationr&)r'�
startswithr�os�sep�state�document�settingsrCr�exists�logger�warningrrErG�join�srcdirr�dirnamerDrr)r*)r1rC�filename�abspath�docdirr4r6r7r*qs 



� 
zCSVTable.runr8r6r6r4r7r\lr>r\crJ)�	ListTablez}The list-table directive which sets source and line information to its caption.

    Only for docutils-0.13 or older version.r#crL)NzListTable is deprecated.rMrPr4r6r7r*�rQz
ListTable.runcrRrSrTrVr4r6r7rU�rYzListTable.make_titlerZr6r6r4r7ro�r[roc@sHeZdZUdZdZejejeje	d�Z
eed<dZ
deefdd�Zd	S)
�CodezqParse and mark up content of a code block.

    This is compatible with docutils' :rst:dir:`code` directive.
    r&)�class�forcer$�number-lines�option_specTr#cCs�|��t|j�d�|j�}tj|||j�dg�d|jvid�}|�|�t	||�|j
r6|j
d|d<n|jj�d|j
j�|d<d|jvrYd	|d
<|jdrY|jd|dd<|gS)
N�
�classesrr)rvrr�highlight_argsr�language�highlight_languagersT�linenosrw�linenostart)�assert_has_contentrr'rir?r	�
literal_block�getr.r�	argumentsrC�	temp_data�configry)r1�coderIr6r6r7r*�s(
�


�

zCode.runN)r9r:r;r<�optional_argumentsr
�class_option�flag�	unchangedrrtr�__annotations__�has_contentrr
r*r6r6r6r7rp�s
�rpc@sdeZdZUdZdZdZdZejejej	ej
d�Zee
d<deefdd�Zd	eedd
fdd�Zd
S)
�
MathDirectiveTrr&)�labelr$rq�nowraprtr#c	Cs�d�|j�}|jr|jdr|jdd|}|j�d|j�d��}tj|||j�dg�|jjd|d|jvd�}|�	|�|�
|�|g}|�|�|S)	Nrurz

r�r$rqr�)rvrE�numberr�r�)rir?rr'r~r	�
math_blockrCrEr.r�
add_target)r1�latexr�rI�retr6r6r7r*�s �


zMathDirective.runr�NcCs�ttj|d�}|ddks|jjr&|ds&|j�d�}d|jj|f|d<|ds,dStt|j�	d��}|j
|jj|d|d�|�|d�|d<td	|d�}tj
dd|gd
�}|jj�|�|�d|�dS)Nrr��zsphinx.ext.math#equationsz%s:%d�mathr^r�zequation-%s)�ids)rr	r�r��math_number_allrC�new_serialnorEr�
get_domain�
note_equation�get_equation_number_forr�targetrcrd�note_explicit_target�insert)r1r�rI�seq�domain�node_idr�r6r6r7r��szMathDirective.add_target)r9r:r;r��required_argumentsr��final_argument_whitespacer
r�r�r�rtrr�rr
r*r�r6r6r6r7r��s
�r��appr r#cCsHt�dt�t�dt�t�dt�t�dt�t�dt�dddd�S)	Nr-rz	csv-tabler�r��builtinT)�version�parallel_read_safe�parallel_write_safe)r
�register_directiver"rr\rpr�)r�r6r6r7�setup�s�r�)Cr<rarNr�typingrrrrrr�docutilsr	�docutils.nodesr
rr�docutils.parsers.rstr
�docutils.parsers.rst.directivesrr�docutils.parsers.rst.rolesr�sphinxr�sphinx.deprecationr�sphinx.directivesr�sphinx.domains.mathr�
sphinx.localer�sphinx.utilr�sphinx.util.docutilsr�sphinx.util.nodesr�sphinx.util.osutilrrr�sphinx.util.typingrrrB�$docutils.parsers.rst.directives.miscr�MetaBase�ImportError�$docutils.parsers.rst.directives.htmlr�sphinx.applicationr �	getLoggerr9rgr"rKr\rorpr��strr�r6r6r6r7�<module>sN 
�
.6