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

�$�a|V�@s�dZddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZddlmZddlmZddlmZmZmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)m*Z*m+Z+ddl,m-Z-m.Z.ddl/m0Z0ddl1m2Z2m3Z3m4Z4ddl5m6Z6ddl7m8Z8dd	l9mZ:ddl;m<Z<ddl=m>Z>ddl?m@Z@ddlAmBZBmCZCer�ddlDmEZEddlFmGZGe>�HeI�ZJddiZKGdd�d�ZLd d!d"e%d#dfd$d%�ZMd d!d#eeNe	ffd&d'�ZOdS)(z�
    sphinx.registry
    ~~~~~~~~~~~~~~~

    Sphinx component registry.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
import_module)�
MethodType)
�
TYPE_CHECKING�Any�Callable�Dict�Iterator�List�Optional�Tuple�Type�Union)�nodes)�Input)�Element�Node�TextElement)�Parser)�	Directive)�	Transform)�iter_entry_points)�Builder)�Config)�RemovedInSphinx60Warning)�Domain�Index�ObjType)�
GenericObject�Target)�BuildEnvironment)�ExtensionError�SphinxError�VersionRequirementError)�	Extension)�__)�XRefRole)�logging)�prefixed_warnings)�RoleFunction�TitleGetter)�Sphinx)�
Documenterzsphinxjp.themecorez1.2c@seZdZdwdd�Zdxdeededdfdd	�Zd
ddeddfd
d�Z	d
ddedefdd�Z
dxdeededdfdd�Zdedefdd�Z
dedeefdd�Z	dxdededeededdf
dd�Z	dxdededeeefdeddf
dd�Z	dxdedeededdfd d!�Zd"ddd"gdfd#ed$ed%ed&ed'eed(ed)ededdfd*d+�Z	"	"	dyd#ed$ed%ed'eed(ededdfd,d-�Zdxd.ed/ededdfd0d1�Zdxd2eededdfd3d4�Z d/edeefd5d6�Z!de"eeeffd7d8�Z#d
dd9edefd:d;�Z$d/ede%ee&fd<d=�Z'	dxded>ee(j)deddfd?d@�Z*dAee+dBe,eefddfdCdD�Z-dedee(j)fdEdF�Z.dedGe/de(j)fdHdI�Z0dJee1ddfdKdL�Z2deee1fdMdN�Z3dJee1ddfdOdP�Z4deee1fdQdR�Z5dSedTedUddfdVdW�Z6dXedYee/ee/ge/fddfdZd[�Z7d9ed\e/ddfd]d^�Z8d9ed\e/ddfd_d`�Z9dedefdadb�Z:dxdedceddeddfdedf�Z;	dzdAee<dgedhe=deddf
didj�Z>dedke,eefdle,eefddfdmdn�Z?dedoeddfdpdq�Z@d
ddreddfdsdt�ZAd
dde"eeffdudv�ZBdS){�SphinxComponentRegistry�returnNcCs�i|_i|_i|_g|_i|_i|_i|_i|_i|_i|_	i|_
i|_d|_i|_
g|_g|_g|_g|_i|_i|_i|_i|_i|_g|_dS)N�per_page)�autodoc_attrgettrs�builders�documenters�	css_files�domains�domain_directives�domain_indices�domain_object_types�domain_roles�enumerable_nodes�html_inline_math_renderers�html_block_math_renderers�html_assets_policy�html_themes�js_files�latex_packages�latex_packages_after_hyperref�post_transforms�source_parsers�
source_inputs�
source_suffix�translators�translation_handlers�
transforms��self�rI�1/usr/lib/python3/dist-packages/sphinx/registry.py�__init__7s0
z SphinxComponentRegistry.__init__F�builder�overridecCsft�d|�t|d�sttd�|��|j|jvr+|s+ttd�|j|j|jjf��||j|j<dS)Nz[app] adding builder: %r�namez(Builder class %s has no "name" attributez(Builder %r already exists (in module %s))�logger�debug�hasattrr r$rNr0�
__module__)rHrLrMrIrIrJ�add_builder�s
�z#SphinxComponentRegistry.add_builder�appr*rNc
Csn|durdS||jvr5td|�}zt|�}Wnty+}z	ttd�|�|�d}~ww|�||j�dSdS)Nzsphinx.buildersz?Builder name %s not registered or available through entry point)r0r�next�
StopIterationr!r$�load_extension�module_name)rHrTrN�entry_points�entry_point�excrIrIrJ�preload_builder�s 

�����z'SphinxComponentRegistry.preload_buildercCs(||jvr
ttd�|��|j||�S)NzBuilder name %s not registered)r0r!r$)rHrTrNrIrIrJ�create_builder�s
z&SphinxComponentRegistry.create_builder�domaincCs>t�d|�|j|jvr|sttd�|j��||j|j<dS)Nz[app] adding domain: %rzdomain %s already registered)rOrPrNr3r r$)rHr^rMrIrIrJ�
add_domain�sz"SphinxComponentRegistry.add_domaincCs
||jvS�N)r3)rHr^rIrIrJ�
has_domain�s
z"SphinxComponentRegistry.has_domain�envccs��|j��D]B}||�}|j�|j�|ji��|j�|j�|ji��|j	�
|j�|jg��|j�|ji��
�D]
\}}|�||�q:|VqdSr`)r3�values�
directives�updater4�getrN�rolesr7�indices�extendr5r6�items�add_object_type)rHrb�DomainClassr^rN�objtyperIrIrJ�create_domains�s��z&SphinxComponentRegistry.create_domains�clscC�ft�d|||f�||jvrttd�|��|j�|i�}||vr-|s-ttd�||f��|||<dS)Nz$[app] adding directive to domain: %r�domain %s not yet registeredz3The %r directive is already registered to domain %s)rOrPr3r r$r4�
setdefault)rHr^rNrorMrdrIrIrJ�add_directive_to_domain�s
�z/SphinxComponentRegistry.add_directive_to_domain�rolecCrp)Nz[app] adding role to domain: %rrqz.The %r role is already registered to domain %s)rOrPr3r r$r7rr)rHr^rNrtrMrgrIrIrJ�add_role_to_domain�s
�z*SphinxComponentRegistry.add_role_to_domain�indexcCsht�d||f�||jvrttd�|��|j�|g�}||vr-|s-ttd�|j|f��|�|�dS)Nz [app] adding index to domain: %rrqz/The %r index is already registered to domain %s)	rOrPr3r r$r5rrrN�append)rHr^rvrMrhrIrIrJ�add_index_to_domain�s
�z+SphinxComponentRegistry.add_index_to_domain��
directivename�rolename�
indextemplate�
parse_node�
ref_nodeclass�objname�doc_field_typesc	
Cs�t�d|||||||f�t|ttf|t|�|d��}	|�d||	�|�d|t|d��|j	�
di�}
||
vrA|sAttd�|��t
|pE||�|
|<dS)Nz[app] adding object type: %r)r|r}r��std��innernodeclassz(The %r object_type is already registered)rOrP�typer�object�staticmethodrsrur%r6rrr r$r)rHrzr{r|r}r~rr�rM�	directive�object_typesrIrIrJrk�s(�����z'SphinxComponentRegistry.add_object_typec	Cs�t�d|||||f�t|ttfd|i�}|�d||�|�d|t|d��|j�	di�}||vr;|s;t
td�|��t|p?||�||<dS)Nz[app] adding crossref type: %rr|r�r�z*The %r crossref_type is already registered)
rOrPr�rr�rsrur%r6rrr r$r)	rHrzr{r|r~rrMr�r�rIrIrJ�add_crossref_type�s���z)SphinxComponentRegistry.add_crossref_type�suffix�filetypecCs:t�d||�||jvr|sttd�|��||j|<dS)Nz"[app] adding source_suffix: %r, %rz&source_suffix %r is already registered)rOrPrCr r$)rHr�r�rMrIrIrJ�add_source_suffixsz)SphinxComponentRegistry.add_source_suffix�parsercCsDt�d|�|jD]}||jvr|sttd�|��||j|<q	dS)Nz%[app] adding search source_parser: %rz*source_parser for %r is already registered)rOrP�	supportedrAr r$)rHr�rMr�rIrIrJ�add_source_parser
s
��z)SphinxComponentRegistry.add_source_parserc
Cs8z|j|WSty}z	ttd�|�|�d}~ww)Nz#Source parser for %s not registered)rA�KeyErrorr!r$)rHr�r[rIrIrJ�get_source_parsers��z)SphinxComponentRegistry.get_source_parsercC�|jSr`)rArGrIrIrJ�get_source_parsers�z*SphinxComponentRegistry.get_source_parsers�filenamecCs(|�|�}|�}t|t�r|�|�|Sr`)r��
isinstance�SphinxParser�set_application)rHrTr��parser_classr�rIrIrJ�create_source_parser!s



z,SphinxComponentRegistry.create_source_parsercCsPt�dt�z|j|WSty'z|jdWYSty&YYdSww)Nz9SphinxComponentRegistry.get_source_input() is deprecated.�*)�warnings�warnrrBr�)rHr�rIrIrJ�get_source_input(s���z(SphinxComponentRegistry.get_source_input�
translatorcCs8t�d|�||jvr|sttd�|��||j|<dS)Nz.[app] Change of translator for the %s builder.z Translator for %r already exists)rOrPrDr r$)rHrNr�rMrIrIrJ�add_translator5sz&SphinxComponentRegistry.add_translator�node�kwargsc	Kszt�d||�|��D]/\}}|j�|i�}z
|\}}||f||j<Wqty:}zttd�||f�|�d}~wwdS)Nz)[app] adding translation_handlers: %r, %rzEkwargs for add_node() must be a (visit, depart) function tuple: %r=%r)	rOrPrjrErr�__name__�
ValueErrorr r$)	rHr�r��builder_name�handlersrE�visit�departr[rIrIrJ�add_translation_handlers<s"������z0SphinxComponentRegistry.add_translation_handlerscCs|j�|j|j�Sr`)rDrfrN�default_translator_class)rHrLrIrIrJ�get_translator_classJs
�z,SphinxComponentRegistry.get_translator_class�argsc	Gs�|�|�}|sJd|j��||�}|j�|jd�}|dur&|j�|ji�}|��D]\}\}}t|d|t||��|rHt|d|t||��q*|S)Nztranslator not found for %s�visit_�depart_)r�rNrErf�formatrj�setattrr)	rHrLr��translator_classr�r�rNr�r�rIrIrJ�create_translatorNs
�z)SphinxComponentRegistry.create_translator�	transformcC�t�d|�|j�|�dS)Nz[app] adding transform: %r)rOrPrFrw�rHr�rIrIrJ�
add_transform`�z%SphinxComponentRegistry.add_transformcCr�r`)rFrGrIrIrJ�get_transformsdr�z&SphinxComponentRegistry.get_transformscCr�)Nz[app] adding post transform: %r)rOrPr@rwr�rIrIrJ�add_post_transformgr�z*SphinxComponentRegistry.add_post_transformcCr�r`)r@rGrIrIrJ�get_post_transformskr�z+SphinxComponentRegistry.get_post_transformsrm�
documenterr+cC�||j|<dSr`)r1)rHrmr�rIrIrJ�add_documentern�z&SphinxComponentRegistry.add_documenter�typ�
attrgettercCr�r`)r/)rHr�r�rIrIrJ�add_autodoc_attrgetterqsz.SphinxComponentRegistry.add_autodoc_attrgetter�
attributescKs|j�||f�dSr`)r2rw�rHr�r�rIrIrJ�
add_css_filesusz%SphinxComponentRegistry.add_css_filescKs"t�d||�|j�||f�dS)Nz[app] adding js_file: %r, %r)rOrPr=rwr�rIrIrJ�add_js_filexsz#SphinxComponentRegistry.add_js_filecs"|j|j}t�fdd�|D��S)Ncsg|]
}|d�kr|�qS)rrI)�.0�x�rNrIrJ�
<listcomp>~sz=SphinxComponentRegistry.has_latex_package.<locals>.<listcomp>)r>r?�bool)rHrN�packagesrIr�rJ�has_latex_package|sz)SphinxComponentRegistry.has_latex_package�options�after_hyperrefcCsP|�|�rt�d|�t�d|�|r|j�||f�dS|j�||f�dS)Nz#latex package '%s' already includedz[app] adding latex package: %r)r�rOr�rPr?rwr>)rHrNr�r�rIrIrJ�add_latex_package�s
z)SphinxComponentRegistry.add_latex_package�figtype�title_gettercCs@t�d|||�||jvr|sttd�|��||f|j|<dS)Nz*[app] adding enumerable node: (%r, %r, %r)z%enumerable_node %r already registered)rOrPr8r r$)rHr�r�r�rMrIrIrJ�add_enumerable_node�sz+SphinxComponentRegistry.add_enumerable_node�inline_renderers�block_rendererscCsBt�d|||�||jvrttd�|��||j|<||j|<dS)Nz+[app] adding html_math_renderer: %s, %r, %rz&math renderer %s is already registered)rOrPr9r r$r:)rHrNr�r�rIrIrJ�add_html_math_renderer�s�

z.SphinxComponentRegistry.add_html_math_renderer�
theme_pathcCr�r`)r<)rHrNr�rIrIrJ�add_html_theme�r�z&SphinxComponentRegistry.add_html_theme�extnamecCsd||jvrdS|tvrt�td�|t|�dStd�|}t|���zt|�}Wn!tyJ}zt�td�t	�
��ttd�||�|�d}~wwt|dd�}|dur`t�td�|�i}nz||�}Wnt
y}}zt
td�||f�|�d}~ww|dur�i}nt|t�s�t�td	�|�i}t||fi|��|j|<Wd�dS1s�wYdS)
zLoad a Sphinx extension.Nz\the extension %r was already merged with Sphinx since version %s; this extension is ignored.zwhile setting up extension %s:zOriginal exception:
zCould not import extension %s�setupzMextension %r has no setup() function; is it really a Sphinx extension module?zpThe %s extension used by this project needs at least Sphinx v%s; it therefore cannot be built with this version.zuextension %r returned an unsupported object from its setup() function; it should return None or a metadata dictionary)�
extensions�EXTENSION_BLACKLISTrO�warningr$r'r�ImportError�verbose�	traceback�
format_excr �getattrr"r��dictr#)rHrTr��prefix�mod�errr��metadatarIrIrJrW�s^

�
����
������

�"�z&SphinxComponentRegistry.load_extensioncCs,ddlm}dd�|j��D�}||d<|S)Nr)�ENV_VERSIONcSs&i|]}|j�d�r|j|jd�qS)�env_version)r�rfrN)r��extrIrIrJ�
<dictcomp>�s
�z:SphinxComponentRegistry.get_envversion.<locals>.<dictcomp>�sphinx)�sphinx.environmentr�r�rc)rHrTr��
envversionrIrIrJ�get_envversion�sz&SphinxComponentRegistry.get_envversion)r-N)F)ryNryF)NF)Cr�rR�__qualname__rKrrr�rS�strr\r]rr_rarrrnrrsr
r(r%rurrxrrr	rkr�r�rr�r�rr�r�r
rr�r�NodeVisitorr�rrr�r�rr�rr�r�r�r�r�r�r�r�r�r�rr)r�r�r�rWr�rIrIrIrJr,6s�
M	���
�
�
��
�
��
�������
�����
���
�

�
��
����
�
�
�
�.r,rTr*�configr-cCs\|jj��D]\}}||jjvr||jj|<q|jj|dur%||jj|<q|jj|j_dS)zDMerge any user-specified source_suffix with any added by extensions.N)�registryrCrjr�)rTr�r�r�rIrIrJ�merge_source_suffix�s�r�cCs|jdtdd�dddd�S)Nz
config-initedi )�priority�builtinT)�version�parallel_read_safe�parallel_write_safe)�connectr�)rTrIrIrJr��s
�r�)P�__doc__r�r��	importlibr�typesr�typingrrrrrr	r
rrr
�docutilsr�docutils.ior�docutils.nodesrrr�docutils.parsersr�docutils.parsers.rstr�docutils.transformsr�
pkg_resourcesr�sphinx.buildersr�
sphinx.configr�sphinx.deprecationr�sphinx.domainsrrr�sphinx.domains.stdrrr�r�
sphinx.errorsr r!r"�sphinx.extensionr#�
sphinx.localer$�sphinx.parsersr��sphinx.rolesr%�sphinx.utilr&�sphinx.util.loggingr'�sphinx.util.typingr(r)�sphinx.applicationr*�sphinx.ext.autodocr+�	getLoggerr�rOr�r,r�r�r�rIrIrIrJ�<module>sN
0
�"

https://t.me/RX1948 - 2025