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

�$�a�O�
@sFdZddlZddlZddlZddlmZddlmZmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZmZddlmZmZddlmZdd	lmZdd
l m!Z!m"Z"ddl#m$Z$ddl%m&Z&e
rvdd
l'm(Z(ddl)m*Z*e�+e,�Z-dZ.e/ej0ej1fZ2e�3d�Z4Gdd�de�Z5dede6fdd�Z7Gdd�d�Z8Gdd�d�Z9de:dee$de
e:effdd�Z;dd d!e9ddfd"d#�Z<dd d!e9ddfd$d%�Z=dd d!e9ddfd&d'�Z>dd d!e9ddfd(d)�Z?dd d!e9ddfd*d+�Z@dd d!e9ddfd,d-�ZAdd d.d/d0ee:d1ee:d2ee:dee:fd3d4�ZBdd de
e:effd5d6�ZCdS)7z�
    sphinx.config
    ~~~~~~~~~~~~~

    Build configuration file handling.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�OrderedDict)�getenv�path)�
TYPE_CHECKING�Any�Callable�Dict�	Generator�Iterator�List�
NamedTuple�Optional�Set�Tuple�Union)�ConfigError�ExtensionError)�_�__)�logging)�format_date)�cd�fs_encoding)�Tags)�NoneType)�Sphinx)�BuildEnvironmentzconf.pyz^((\d{4}-)?)(\d{4})(?=[ ,])c@s.eZdZUeed<eed<eeefed<dS)�ConfigValue�name�value�rebuildN)�__name__�
__module__�__qualname__�str�__annotations__rr�bool�r'r'�//usr/lib/python3/dist-packages/sphinx/config.pyr&s
r�obj�returncCsjt|t�rdSt|t�r"|��D]\}}t|�rt|�sdSqdSt|tttf�r3tdd�|D��SdS)z'Check if object is serializable or not.Fcss�|]}t|�VqdS�N)�is_serializable)�.0�ir'r'r(�	<genexpr>5s�z"is_serializable.<locals>.<genexpr>T)	�
isinstance�UNSERIALIZABLE_TYPES�dict�itemsr,�list�tuple�set�all)r)�keyrr'r'r(r,,s

��r,c@s>eZdZdZdeddfdd�Zdeeeefde	fdd	�Z
dS)
�ENUMz�Represents the candidates which a config value should be one of.

    Example:
        app.add_config_value('latex_show_urls', 'no', None, ENUM('no', 'footnote', 'inline'))
    �
candidatesr*NcGs
||_dSr+�r:)�selfr:r'r'r(�__init__@�
z
ENUM.__init__rcs.t|ttf�rt�fdd�|D��S|�jvS)Nc3s�|]}|�jvVqdSr+r;)r-�item�r<r'r(r/E��zENUM.match.<locals>.<genexpr>)r0r4r5r7r:)r<rr'r@r(�matchCs
z
ENUM.match)r!r"r#�__doc__r$r=rrrr&rBr'r'r'r(r9:s r9c
@s*eZdZUdZidddgf�dddgf�ddd	egf�d
dd�d	egf�d
ddgf�dddgf�dddgf�dddegf�dddegf�ddgdgf�dddegf�dddgf�dddgf�ddd�dgf�ddd idef�d!d"dgf�d#gdgf�id$ddegf�d%d&dgf�d'd&dgf�d(ddgf�d)ddgf�d*dd	egf�d+d,dgf�d-idgf�d.gd	gf�d/dd	egf�d0ddgf�d1gdgf�d2gd	gf�d3ddegf�d4ddegf�d5d&dgf�d6d7degf��id8ddegf�d9idgf�d:ddgf�d;ddgf�d<gdgf�d=gdgf�d>ddgf�d?d@dgf�dAidgf�dBddgf�dCddegf�dDd&dgf�dEd&dgf�dFddgf�dGddegf�dHd&dgf�dIdJdgf��dKdLgdMdNgdO�dgfi�Zeee	fe
dP<iifdQeeefdReeefdSdfdTdU�ZedydVedRedWe
dSdfdXdY��ZdZed[edSefd\d]�Zdzd^d_�Zdzd`da�ZdZedSefdbdc�ZdZedSefddde�ZdZed[edSdfdfdg�ZdZedSdfdhdi�ZdZedSefdjdk�ZdSeeddffdldm�ZdZed,edneeefdoedSdf
dpdq�ZdneeeefdSeefdrds�ZdSefdtdu�Z dvedSdfdwdx�Z!dS){�Configa�Configuration file abstraction.

    The config object makes the values of all config values available as
    attributes.

    It is exposed via the :py:attr:`sphinx.application.Application.config` and
    :py:attr:`sphinx.environment.Environment.config` attributes. For example,
    to get the value of :confval:`language`, use either ``app.config.language``
    or ``env.config.language``.
    �project�Python�env�author�unknown�project_copyright��html�	copyrightcC�|jSr+)rJ)�cr'r'r(�<lambda>`�zConfig.<lambda>�version�release�today�	today_fmtN�language�locale_dirs�locales�figure_language_filenamez{root}.{language}{ext}� gettext_allow_fuzzy_translationsF�gettext�
master_doc�index�root_doccCrNr+)r\)�configr'r'r(rPmrQ�
source_suffixz.rst�restructuredtext�source_encodingz	utf-8-sig�exclude_patterns�default_role�add_function_parenthesesT�add_module_names�trim_footnote_reference_space�show_authors�pygments_style�highlight_language�default�highlight_options�templates_path�template_bridge�
keep_warnings�suppress_warnings�modindex_common_prefix�
rst_epilog�
rst_prolog�trim_doctest_flags�primary_domain�py�needs_sphinx�needs_extensions�manpages_url�nitpicky�nitpick_ignore�nitpick_ignore_regex�numfig�numfig_secnum_depth��
numfig_format�math_number_all�math_eqref_format�math_numfig�
tls_verify�tls_cacerts�
user_agent�smartquotes�smartquotes_action�qDe�smartquotes_excludes�ja�man�text)�	languages�builders�
config_valuesr_�	overridesr*cCs~t|�|_tj��|_||_|�dd�|_d|jvr6t	|jdt
�r.|j�d��d�|d<n|j�d�|d<|�dg�|_
dS)N�setup�
extensions�,)r2r�rDr��copy�values�_raw_config�getr�r0r$�pop�splitr�)r<r_r�r'r'r(r=�s

zConfig.__init__�confdir�tagscCs>t�|t�}t�|�sttd�|��t||�}|||pi�S)z/Create a Config object from configuration file.z4config directory doesn't contain a conf.py file (%s))r�join�CONFIG_FILENAME�isfilerr�eval_config_file)�clsr�r�r��filename�	namespacer'r'r(�read�s
�
zConfig.readrrc
CsFt|t�s|S|j|d}|j|dtkr|S|j|dtthkr2|dkr*dS|dkr0dS|St|�tusB|j|dtgkrL|dkrHdSt|�St|t�r]ttd�||df��t|t	�rg|�
d	�St|t�r�zt|�WSty�}zttd
�||f�|�d}~wwt|d�r�|S|dur�t|t�s�ttd�|��|S)
Nr��0F�1TzZcannot override dictionary config setting %r, ignoring (use %r to set individual elements)z
.key=valuer�z/invalid number %r for config value %r, ignoring�__call__zAcannot override config setting %r with unsupported type, ignoring)
r0r$r�rr&�typer2�
ValueErrorrr4r��int�hasattr)r<rr�defvalue�excr'r'r(�convert_overrides�sN
 

�



����
�zConfig.convert_overridescCs�gd�}|D];}z!||jvr|�||j|�|j|<n
||jvr(|j||j|<WqtyA}zt�d|�WYd}~qd}~wwdS)zs
        Initialize some limited config variables before initializing i18n and loading
        extensions.
        )rwrprVrW�%sN)r�r��__dict__r�r��logger�warning)r<�	variablesrr�r'r'r(�pre_init_values�s

����zConfig.pre_init_valuescCs�|j}|j��D]U\}}z9d|vr#|�dd�\}}||�|i�|<Wq||jvr2t�td�|�Wqt	|t
�r@|�||�||<n|||<Wqty]}zt�d|�WYd}~qd}~ww|D]}||jvrn|||j
|<q`dS)N�.rz-unknown config value %r in override, ignoringr�)r�r�r3r��
setdefaultr�r�r�rr0r$r�r�r�)r<r_�valnamer�realvalnamer8r�rr'r'r(�init_values�s2

�
���
��zConfig.init_valuescCsP|�d�r	t|��||jvrttd�|��|j|d}t|d�r&||�S|S)NrzNo such config value: %srr�)�
startswith�AttributeErrorr�rr�)r<rrkr'r'r(�__getattr__�s


zConfig.__getattr__cCs
t||�Sr+)�getattr�r<rr'r'r(�__getitem__r>zConfig.__getitem__cCst|||�dSr+)�setattr�r<rrr'r'r(�__setitem__�zConfig.__setitem__cCst||�dSr+)�delattrr�r'r'r(�__delitem__szConfig.__delitem__cCs
||jvSr+)r�r�r'r'r(�__contains__r>zConfig.__contains__ccs2�|j��D]\}}t|t||�|d�VqdS)Nr)r�r3rr�r�r'r'r(�__iter__s��zConfig.__iter__r �typescCs.||jvr
ttd�|��|||f|j|<dS)NzConfig value %r already present)r�rr)r<rrkr r�r'r'r(�adds
z
Config.addcs"t�t�r�g��fdd�|D�S)Nc3s�|]
}|j�vr|VqdSr+�r )r-rr�r'r(r/!s�z Config.filter.<locals>.<genexpr>)r0r$)r<r r'r�r(�filters
z
Config.filtercCs�i}|j��D]\}}|�d�st|�sq|||<qi|d<|j��D]\}}t||�}t|�s2d}||ddf|d|<q#|S)z'Obtains serializable data for pickling.rr�Nr)r�r3r�r,r�r�)r<r�r8r�
real_valuer'r'r(�__getstate__#s

zConfig.__getstate__�statecCs|j�|�dSr+)r��update)r<r�r'r'r(�__setstate__:r�zConfig.__setstate__)NN)r*N)"r!r"r#rCr$rrr�rrr%r=�classmethodrr�r�r�r�r�r�r�r�r&r�r	rr�rr�rr
r�r�r�r'r'r'r(rDJs�

�
���
�
�
�
��
��
�
���
�
��
�
�
�
��
�
�
��
 �
!�
"�#�$�
%�&�'�
(�
)�
*�
+�
,�
-�
.�
/�
1�2�
3�
4�
5�6�
7�
8�9���,>
	
)

&"rDr�r�cCs,i}||d<||d<tt�|���{z't|d��}t|��|�t�d�}t||�Wd�n1s3wYWnJt	yP}zt
d�}t||�|�d}~wtyd}z	t
d�}t|�|�d}~wtyk�t
y�}z
t
d�}t|t���|�d}~wwWd�|S1s�wY|S)	zEvaluate a config file.�__file__r��rb�execNz7There is a syntax error in your configuration file: %s
zKThe configuration file (or one of the modules it imports) called sys.exit()z=There is a programmable error in your configuration file:

%s)rr�dirname�open�compiler��encoderr��SyntaxErrorrr�
SystemExit�	Exception�	traceback�
format_exc)r�r�r��f�code�err�msgr�r'r'r(r�>s<���
����
��r��apprr_cCsx|j}t|t�rt|di�|_dSt|ttf�r$tdd�|D��|_dSt|t�r1t|j�|_dSt�t	d|��dS)z�Convert old styled source_suffix to new styled one.

    * old style: str or list
    * new style: a dict which maps from fileext to filetype
    NcSsg|]}|df�qSr+r')r-�sr'r'r(�
<listcomp>jsz)convert_source_suffix.<locals>.<listcomp>zeThe config value `source_suffix' expects a string, list of strings, or dictionary. But `%r' is given.)
r`r0r$rr4r5r2r�r�r)r�r_r`r'r'r(�convert_source_suffix[s

�r�cCs8|j}|rtdd�|��D��s|j|i|_dSdSdS)z�Convert old styled highlight_options to new styled one.

    * old style: options
    * new style: a dict which maps from language name to options
    css�|]}t|t�VqdSr+)r0r2)r-�vr'r'r(r/{rAz,convert_highlight_options.<locals>.<genexpr>N)rlr7r�rj)r�r_�optionsr'r'r(�convert_highlight_optionsts�r�cCs4td�td�td�td�d�}|�|j�||_dS)z$Initialize :confval:`numfig_format`.z
Section %szFig. %szTable %sz
Listing %s)�section�figure�tablez
code-blockN)rr�r�)r�r_r�r'r'r(�init_numfig_format�s�
r�cCsFtd�durdD]}||vrdtd�}t�|||�||<qdSdS)z�Correct values of copyright year that are not coherent with
    the SOURCE_DATE_EPOCH environment variable (if set)

    See https://reproducible-builds.org/specs/source-date-epoch/
    �SOURCE_DATE_EPOCHN)rM�epub_copyrightz\g<1>%sz%Y)rr�copyright_year_re�sub)r�r_�k�replacer'r'r(�correct_copyright_year�s��r�c
Cs~|D]�}|j|j\}}}t|d�r||�}|dur|sq|tur"qt|t�r@|�|j�s?td�}t	�
|j|j|j|jd��qt
|j�t
|�urJqt
|j�|vrRqtt
|j�jt
|j�f�tt
|�j�@}|�t�|roq|r�td�}dd�|D�}t|�dkr�d	�d
�|dd��|d�}	nd�|�}	t	�
|j|jt
|j�|	d
��qtd�}t	�
|j|jt
|j�t
|�d��qdS)z�Check all values for deviation from the default value's type, since
    that can result in TypeErrors all over the place NB.
    r�NzTThe config value `{name}` has to be a one of {candidates}, but `{current}` is given.)r�currentr:zNThe config value `{name}' has type `{current.__name__}'; expected {permitted}.cSsg|]}d�|j��qS)z`{}')�formatr!)r-rOr'r'r(r��sz'check_confval_types.<locals>.<listcomp>r�z	{}, or {}z, ���z or )rr��	permittedzZThe config value `{name}' has type `{current.__name__}', defaults to `{default.__name__}'.)rr�rk)r�rr�rr0r9rBrrr�r�r�r:r�r6�	__bases__�discard�object�lenr�)
r�r_�confvalrkr �annotationsr��common_bases�wrapped_annotationsr�r'r'r(�check_confval_types�sZ

���
�

�
��rcCs8|j}|r|j�|�st�td�|�d|_dSdSdS)Nz%primary_domain %r not found, ignored.)ru�registry�
has_domainr�r�r)r�r_rur'r'r(�check_primary_domain�s

�rrGr�added�changed�removedcCs>|jjdkrd|jjvrd|jjvrt�td��d|j_|S)zjAdjust root_doc to 'contents' to support an old project which does not have
    any root_doc setting.
    r]�contentszkSince v2.0, Sphinx uses "index" as root_doc by default. Please add "root_doc = 'contents'" to your conf.py.)r_r^rE�docnamesr�r�r)r�rGrrrr'r'r(�check_root_doc�sr
cCsx|jdtdd�|jdtdd�|jdtdd�|jdtdd�|jdtdd�|jdtdd�|�dt�dddd�S)Nz
config-initedi )�priorityzenv-get-outdated�builtinT)rR�parallel_read_safe�parallel_write_safe)�connectr�r�r�r�rrr
)r�r'r'r(r��s�r�)DrC�rer�r��collectionsr�osrr�typingrrrrr	r
rrr
rrr�
sphinx.errorsrr�
sphinx.localerr�sphinx.utilr�sphinx.util.i18nr�sphinx.util.osutilrr�sphinx.util.tagsr�sphinx.util.typingr�sphinx.applicationr�sphinx.environmentr�	getLoggerr!r�r�r��
ModuleType�FunctionTyper1r�r�rr&r,r9rDr$r�r�r�r�r�rrr
r�r'r'r'r(�<module>sR
8

"u
7��
�

https://t.me/RX1948 - 2025