https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sphinx/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sphinx/__pycache__/roles.cpython-310.pyc
o

�$�a6�@s�UdZddlZddlmZmZmZmZmZmZddl	m
Z
mZddlm
Z
mZmZmZddlmZddlmZddlmZdd	lmZmZdd
lmZerYddlmZddlmZej e
j!e
j"ej#ej ej$ej#ej#ej e
j"d
�
Z%Gdd�de�Z&Gdd�de&�Z'Gdd�de�Z(Gdd�de�Z)e�*d�Z+Gdd�de�Z,Gdd�de,�Z-e�*d�Z.e�*d�Z/Gdd�de�Z0e�*dej1�Z2Gd d!�d!e�Z3e&ej4d"�e'd#d$�e(�e)�e,�e-�e0�e0�e3�d%�	Z5ee6efe7d&<d'd(d)ee6effd*d+�Z8dS),z�
    sphinx.roles
    ~~~~~~~~~~~~

    Handlers for additional ReST roles.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
TYPE_CHECKING�Any�Dict�List�Tuple�Type)�nodes�utils)�Element�Node�TextElement�system_message)�addnodes)�_)�ws_re)�
ReferenceRole�
SphinxRole)�RoleFunction)�Sphinx)�BuildEnvironment)
�command�dfn�kbd�
mailheader�makevar�manpage�mimetype�	newsgroup�program�regexpcsBeZdZUdZejZeee	d<e
jZee
e	d<			d!dededeedee
ded	df�fd
d�
Zded
ed	eeeffdd�Zd	eeeeeffdd�Zd	eeeeeffdd�Zd	eeeeeffdd�Zdddededed
ed	eeeffdd�Zde
jdddeded	eeeeeff
dd �Z�ZS)"�XRefRoleaA
    A generic cross-referencing role.  To create a callable that can be used as
    a role function, create an instance of this class.

    The general features of this role are:

    * Automatic creation of a reference and a content node.
    * Optional separation of title and target with `title <target>`.
    * The implementation is a class rather than a function to make
      customization easier.

    Customization can be done in two ways:

    * Supplying constructor parameters:
      * `fix_parens` to normalize parentheses (strip from target, and add to
        title if configured)
      * `lowercase` to lowercase the target
      * `nodeclass` and `innernodeclass` select the node classes for
        the reference and the content node

    * Subclassing and overwriting `process_link()` and/or `result_nodes()`.
    �	nodeclass�innernodeclassFN�
fix_parens�	lowercase�
warn_dangling�returncs<||_||_||_|dur||_|dur||_t���dS�N)r#r$r%r!r"�super�__init__)�selfr#r$r!r"r%��	__class__��./usr/lib/python3/dist-packages/sphinx/roles.pyr)GszXRefRole.__init__�title�targetcCsJ|js|�d�r|dd�}|jjr|d7}|�d�r!|dd�}||fS)Nz()���)�has_explicit_title�endswith�config�add_function_parentheses)r*r/r0r-r-r.�update_title_and_targetTs

z XRefRole.update_title_and_targetcCsnd|jvrd|j|_|_d|jg|_n|j�dd�\|_|_d|jd|j|jfg|_|jr3|��S|��S)N�:��xref�z%s-%s)�name�	refdomain�reftype�classes�split�disabled�create_non_xref_node�create_xref_node�r*r-r-r.�runas
zXRefRole.runcCs\t�|jdd��}|jrd|_|�|d�\}}|j|j||jd�}|j	|j
j|j|dd�S)Nr:Fr8�r>��is_ref)
r	�unescape�textr#r2r6r"�rawtextr>�result_nodes�inliner�document�env)r*rIr0�noder-r-r.rAnszXRefRole.create_non_xref_nodecCs�|j}|j}|jr
|��}|jr|�||�\}}|jj|j|j	|j
|jd�}|j|j
fi|��}|�|�|�|j||j
||�\}}||d<||j|j
||jd�7}|j|jj|j|dd�S)N)�refdocr<r=�refexplicit�refwarn�	reftargetrETrF)r0r/r$�lowerr#r6rN�docnamer<r=r2r%r!rJ�set_source_info�process_linkr"r>rKrLrM)r*r0r/�options�refnoder-r-r.rBws(�
�zXRefRole.create_xref_noderNrrYr2cCs|t�d|�fS)z�Called after parsing title and target text, and creating the
        reference node (given in *refnode*).  This method can alter the
        reference node and must return a new (or the same) ``(title, target)``
        tuple.
        � )r�sub)r*rNrYr2r/r0r-r-r.rW�szXRefRole.process_linkrMrOrGcCs
|ggfS)a(Called before returning the finished nodes.  *node* is the reference
        node if one was created (*is_ref* is then true), else the content node.
        This method can add other nodes and must return a ``(nodes, messages)``
        tuple (the usual return value of a role function).
        r-)r*rMrNrOrGr-r-r.rK�s
zXRefRole.result_nodes)FFNNF)�__name__�
__module__�__qualname__�__doc__r�pending_xrefr!rr
�__annotations__r�literalr"r�boolr)�strrr6rrr
rDrArBrWrMrK�
__classcell__r-r-r+r.r ,s@
�����


	��

�	��r cs>eZdZdddededededeeeff�fdd	�Z�ZS)
�AnyXRefRolerNrrYr2r/r0r&cs&t��|||||�}|j�|j�|Sr')r(rW�
attributes�update�ref_context)r*rNrYr2r/r0�resultr+r-r.rW�szAnyXRefRole.process_link)	r\r]r^r
rcrdrrWrer-r-r+r.rf�s��
�rfc@�8eZdZdeeeeeffdd�Zdefdd�Z	dS)�PEPr&c
Cs
d|j�d�}dtd�|j|ddfg}tj|d�}tjdd|gd�}|jj�	|�z,|�
�}tjddd|d	gd
�}|jrI|t�
|j|j�7}n
d|j}|t�
||�7}Wn&ty}|jjjd|j|jd
�}|j�|j|j|�}	|	g|gfYSw|||ggfS)N�index-%s�index�singlez$Python Enhancement Proposals; PEP %sr8��entries��idsF�pep��internal�refurir>zPEP zinvalid PEP number %s��line)rN�new_serialnorr0rrnrrLrM�note_explicit_target�	build_uri�	referencer2�strongr/�
ValueError�reporter�error�lineno�problematicrJ�
r*�	target_idrqrnr0rwr}r/�msg�prbr-r-r.rD�s.�
���zPEP.runcCsV|jjjj}|j�dd�}t|�dkr!|dt|d�|dfS|dt|d�S)N�#r:�zpep-%04d#%srzpep-%04d)rLrM�settings�pep_base_urlr0r?�len�int�r*�base_url�retr-r-r.r|�s
z
PEP.build_uriN�
r\r]r^rrrr
rDrdr|r-r-r-r.rl�srlc@rk)�RFCr&c
Csd|j�d�}dd|j|ddfg}tj|d�}tjdd|gd�}|jj�|�z,|�	�}tj
ddd|d	gd
�}|jrG|t�|j
|j
�7}n
d|j
}|t�||�7}Wn&ty{|jjjd|j|jd
�}|j�|j|j|�}	|	g|gfYSw|||ggfS)NrmrnrozRFC; RFC %sr8rprrF�rfcruzRFC zinvalid RFC number %srx)rNrzr0rrnrrLrMr{r|r}r2r~r/rr�r�r�r�rJr�r-r-r.rD�s*
���zRFC.runcCsb|jjjj}|j�dd�}t|�dkr%||jjt|d�d|dS||jjt|d�S)Nr�r:r�r)	rLrMr��rfc_base_urlr0r?r��rfc_urlr�r�r-r-r.r|�s
$z
RFC.build_uriNr�r-r-r-r.r��sr��(?<!&)&(?![&\s])c@s4eZdZe�d�Zdeeeee	ffdd�Z
dS)�GUILabelr�r&cCs�tj|j|jgd�}|j�|j�}|t�|�d��7}|D](}|�	dd�}t�|d�}tjdd|dgd�}||7}|t�|dd��7}q|ggfS)	N)rJr>rz&&�&r8�acceleratorrEr:)
r�inlinerJr;�amp_rer?rI�Text�pop�replace)r*rO�spans�span�letterr�r-r-r.rD�s
zGUILabel.runN)r\r]r^�re�compiler�rrrr
rDr-r-r-r.r��s
"r�cs6eZdZdZdeeeeeff�fdd�Z�Z	S)�
MenuSelectionu‣r&cs|j�d|j�|_t���S)Nz-->)rIr��BULLET_CHARACTERr(rDrCr+r-r.rDs
zMenuSelection.run)
r\r]r^r�rrrr
rDrer-r-r+r.r�s*r�z	{([^}]+)}z(\\*{|\\*})c@sJeZdZe�d�Zdeeeee	ffdd�Z
dedeefdd�ZdS)	�EmphasizedLiteralz(\\\\|\\{|\\}|{|})r&cCs>|�|j�}tj|jdg|�R|j��|jgd��}|ggfS)Nr8)�roler>)�parserIrrbrJr;rT)r*�childrenrOr-r-r.rDs
�
zEmphasizedLiteral.runrIcCsxg}dg}|j�|�D]�}|dkr|dd7<q|dkr>t|�dkr3|ddkr3|dd7<q|�d�|�d�q|dkr�t|�d	krx|d
dkrxt|d�dkrx|drg|�t�|d|d��|�t�|d|d��dg}q|�d�d�|�g}q|dkr�|dd7<q|d
kr�|dd7<q|d|7<qd�|�r�d�|�}|�t�||��|S)Nr8z\\����\�{r�r1�}�r:rz\{z\})�	parens_rer?r��appendrr��emphasis�join)r*rIrj�stack�partr-r-r.r�s6
(


zEmphasizedLiteral.parseN)
r\r]r^r�r�r�rrrr
rDrdr�r-r-r-r.r�s
r��	\((.*)\)$c@s8eZdZe�dej�Zdeee	ee
ffdd�ZdS)�Abbreviationr�r&cCsd|j��}|j�|j�}|r!|jd|�����}|�d�|d<n|j}tj	|j
|fi|��ggfS)Nr:�explanation)rX�copy�abbr_re�searchrI�start�strip�groupr�abbreviationrJ)r*rX�matchedrIr-r-r.rDLs
zAbbreviation.runN)r\r]r^r�r��Sr�rrrr
rDr-r-r-r.r�Is"r�)r!T)r%)	�download�anyrtr��guilabel�
menuselection�file�samp�abbr�specific_docroles�apprr&cCstddlm}t��D]\}}|�||�}|�||d|gi�}|�||�q
t��D]
\}}|�||�q)dddd�S)Nr)�rolesr>�builtinT)�version�parallel_read_safe�parallel_write_safe)�docutils.parsers.rstr��generic_docroles�items�GenericRole�
CustomRole�register_local_roler�)r�r��rolenamer!�genericr��funcr-r-r.�setuphs�r�)9r_r��typingrrrrrr�docutilsrr	�docutils.nodesr
rrr
�sphinxr�
sphinx.localer�sphinx.utilr�sphinx.util.docutilsrr�sphinx.util.typingr�sphinx.applicationr�sphinx.environmentr�literal_strongr�rb�literal_emphasisrr�r rfrlr�r��_amp_rer�r��
_litvar_rer�r�r��_abbr_rer��download_referencer�rdrar�r-r-r-r.�<module>s^
 �y	#
"

2
�

https://t.me/RX1948 - 2025