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__/__init__.cpython-310.pyc
o

�$�a�)�@sddZddlZddlmZmZmZmZmZmZm	Z	m
Z
ddlmZddl
mZddlmZmZddlmZddlmZdd	lmZmZdd
lmZddlmZmZmZddlmZdd
l m!Z!erfddl"m#Z#e�$d�Z%e�$d�Z&e	d�Z'de(de)fdd�Z*Gdd�deee'�Z+Gdd�de�Z,Gdd�de�Z-edde+ieddi�dd dee(effd!d"�Z.dS)#z�
    sphinx.directives
    ~~~~~~~~~~~~~~~~~

    Handlers for additional ReST directives.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
TYPE_CHECKING�Any�Dict�Generic�List�Tuple�TypeVar�cast)�nodes)�Node)�
directives�roles)�addnodes)�desc_signature)�RemovedInSphinx50Warning�deprecated_alias)�docutils)�DocFieldTransformer�Field�
TypedField)�SphinxDirective)�
OptionSpec)�Sphinxz\\\nz\\(.)�T�argument�returncCs(|durdSt|�}|dkrtd��|S)zS
    Check for an integer argument or None value; raise ``ValueError`` if not.
    Nrz(negative value; must be positive or zero)�int�
ValueError)r�value�r�</usr/lib/python3/dist-packages/sphinx/directives/__init__.py�optional_int%sr!c@s eZdZUdZdZdZdZdZdej	iZ
eed<gZ
eeed<dZeed	<dZeed
<dZejed<iZeeeeeffed<d
eeeeefffdd�Zd
eefdd�Zdeded
efdd�Zdededed
dfdd�Zd"dd�Z dej!d
dfdd�Z"d"dd�Z#d
ee$fd d!�Z%dS)#�ObjectDescriptionz�
    Directive to describe a class, function or similar object.  Not used
    directly, but subclassed (in domain-specific directives) to add custom
    behavior.
    T�r�noindex�option_spec�doc_field_typesN�domain�objtype�	indexnode�_doc_field_type_maprcCsf|jikr0i|_|jD]$}|jD]	}|df|j|<q|jr/tt|�}|jD]	}|df|j|<q%q|jS)NFT)r*r&�names�is_typedr	r�	typenames)�self�field�name�typed_fieldrrr �get_field_type_mapJs




�z$ObjectDescription.get_field_type_mapcCs<t�d|jd��d�}|jjrdd�|D�Sdd�|D�S)z�
        Retrieve the signatures to document from the directive arguments.  By
        default, signatures are given as arguments, one per line.
        �r�
cSsg|]
}t�d|����qS)z\1)�strip_backslash_re�sub�strip��.0�linerrr �
<listcomp>`sz4ObjectDescription.get_signatures.<locals>.<listcomp>cSsg|]}|���qSr)r7r8rrr r;bs)�nl_escape_rer6�	arguments�split�config�strip_signature_backslash)r.�linesrrr �get_signaturesXsz ObjectDescription.get_signatures�sig�signodecCst�)a�
        Parse the signature *sig* into individual nodes and append them to
        *signode*. If ValueError is raised, parsing is aborted and the whole
        *sig* is put into a single desc_name node.

        The return value should be a value that identifies the object.  It is
        passed to :meth:`add_target_and_index()` unchanged, and otherwise only
        used to skip duplicates.
        )r)r.rCrDrrr �handle_signatureds
z"ObjectDescription.handle_signaturer0cC�dS)z�
        Add cross-reference IDs and entries to self.indexnode, if applicable.

        *name* is whatever :meth:`handle_signature()` returned.
        Nr)r.r0rCrDrrr �add_target_and_indexpsz&ObjectDescription.add_target_and_indexcCrF)z�
        Called before parsing content. Used to set information about the current
        directive context on the build environment.
        Nr�r.rrr �before_contentx�z ObjectDescription.before_content�contentnodecCrF)z�
        Called after creating the content through nested parsing,
        but before the ``object-description-transform`` event is emitted,
        and before the info-fields are transformed.
        Can be used to manipulate the content.
        Nr)r.rKrrr �transform_contentsz#ObjectDescription.transform_contentcCrF)z�
        Called after parsing content. Used to reset information about the
        current directive context on the build environment.
        NrrHrrr �
after_content�rJzObjectDescription.after_contentc		Cs�d|jvr|j�dd�\|_|_nd|j|_|_tjgd�|_t��}|jj	|_	|j|d<|j|d<|d<d|j
v|d<}|jrK|d	�|j�|d	�|d�g|_|�
�}t|�D]F\}}t�|d�}|�|�|�|�z|�||�}Wnty�|��|t�||�7}Yq_w||jvr�|j�|�|s�|�|||�q_t��}|�|�|jr�|jd
|jjd<|��|j�|j|j|�|�|�|jj�d|j|j|�t |��!|�d
|jjd<|�"�|j|gS)a
        Main directive entry function, called by docutils upon encountering the
        directive.

        This directive is meant to be quite easily subclassable, so it delegates
        to several additional methods.  What it does:

        * find out if called as a domain-specific directive, set self.domain
        * create a `desc` node to fit all description inside
        * parse standard options, currently `noindex`
        * create an index node if needed as self.indexnode
        * parse all given signatures (as returned by self.get_signatures())
          using self.handle_signature(), which should either return a name
          or raise ValueError
        * add index entries using self.add_target_and_index()
        * parse the content and handle doc fields in it
        �:r#r3)�entriesr'r(�desctyper$�classesr�object�object-description-transformN)#r0r>r'r(r�indexr)�desc�state�document�options�appendr+rB�	enumerater�set_source_inforEr�clear�	desc_namerG�desc_content�env�	temp_datarI�nested_parse�content�content_offsetrL�app�emitr�
transform_allrM)	r.�noder$�
signatures�irCrDr0rKrrr �run�sX




�
�



�
zObjectDescription.run)rN)&�__name__�
__module__�__qualname__�__doc__�has_content�required_arguments�optional_arguments�final_argument_whitespacer�flagr%r�__annotations__r&rrr'�strr(r)rrTr*rr�boolr2rBrrrErGrIr^rLrMrrjrrrr r"2s*
�

	r"c@s*eZdZdZdZdZdeefdd�ZdS)�DefaultRolezK
    Set the default interpreted text role.  Overridden from docutils.
    r#FrcCs�|js
t�d�gS|jd}t�||jj|j|jj	�\}}|r-t�
d|�||jjd<nt
�|j|j�}|jj	}|jd|||jd�}||g7}ttt
j|�S)Nr3r�default_rolez#Unknown interpreted text role "%s".)r:)r=r�unregister_roler
�role�
state_machine�language�linenorV�reporter�
register_roler_r`r
�
literal_block�
block_text�errorr	rr)r.�	role_namerz�messagesr�r~r�rrr rj�s"


�
�
zDefaultRole.runN)	rkrlrmrnrqrrrrrjrrrr rw�s
rwc@s@eZdZUdZdZdZdZdZiZe	e
d<deefdd�Z
d	S)
�
DefaultDomainzH
    Directive to (re-)set the default domain for this source file.
    Fr#rr%rcCs(|jd��}|jj�|�|jjd<gS)Nr�default_domain)r=�lowerr_�domains�getr`)r.�domain_namerrr rjszDefaultDomain.runN)rkrlrmrnrorprqrrr%rrtrrrjrrrr r��s
r�zsphinx.directives�
DescDirectivez#sphinx.directives.ObjectDescriptionrdrcCsT|�ddd�t�dt�t�dt�t�dt�t�dt�|�d�d	d
d
d�S)Nr@Fr_zdefault-rolezdefault-domain�describerRrS�builtinT)�version�parallel_read_safe�parallel_write_safe)�add_config_valuer�register_directiverwr�r"�	add_event)rdrrr �setups
�r�)/rn�re�typingrrrrrrrr	rr
�docutils.nodesr�docutils.parsers.rstrr
�sphinxr�sphinx.addnodesr�sphinx.deprecationrr�sphinx.util�sphinx.util.docfieldsrrr�sphinx.util.docutilsr�sphinx.util.typingr�sphinx.applicationr�compiler<r5rrurr!r"rwr�r�rrrr �<module>s>
(


)���