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

�$�a�@s�dZddlmZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZmZmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZzdd
lm Z Wne!ymddlm"Z Ynwervddl#m$Z$de%de&fdd�Z'de%de(fdd�Z)de
e(e%fde%fdd�Z*dede(de
efdd�Z+dede%de%fdd�Z,Gd d!�d!�Z-e de	d"e%d#ed$ede%f
d%d&��Z.Gd'd(�d(e�Z/Gd)d*�d*ee�Z0d+S),z�
    sphinx.jinja2glue
    ~~~~~~~~~~~~~~~~~

    Glue code for the jinja2 templating engine.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�path)�pformat)�
TYPE_CHECKING�Any�Callable�Dict�Iterator�List�Tuple�Union)�
BaseLoader�FileSystemLoader�TemplateNotFound)�Environment)�SandboxedEnvironment)�open_if_exists)�TemplateBridge)�Theme)�logging)�mtimes_of_files)�pass_context)�contextfunction)�Builder�val�returncCst|t�r|��dvSt|�S)N)�true�1�yes�on)�
isinstance�str�lower�bool�r�r$�3/usr/lib/python3/dist-packages/sphinx/jinja2glue.py�_tobool"s
r&cCs zt|�WStyYdSw�Nr)�int�
ValueErrorr#r$r$r%�_toint(s

�r*cCs4|durdSt|���rt|�dkrdSd|S|S)a
    Make val a css dimension. In particular the following transformations
    are performed:

    - None -> 'initial' (default CSS value)
    - 0 -> '0'
    - ints and string representations of ints are interpreted as pixels.

    Everything else is returned unchanged.
    N�initialr�0z%spx)r �isdigitr(r#r$r$r%�_todim/s
r.�values�slicesc
cs��t|�}d}|D]}|dt|dd�7}q	||}d}t|�D]7}d}|}	||dkr3t|�}n||d�D]}|dt|dd�7}|d7}||krQnq9||	|�Vq"dS)Nr�)�list�len�range)
r/r0�seq�length�value�items_per_slice�offset�slice_number�count�startr$r$r%�_slice_indexAs(�
��r=�context�keycCs>d|vr	i|jd<|r||jdvrd|jd|<d|SdS)z+Helper to output each access key only once.�_accesskeysr1zaccesskey="%s"�)�vars)r>r?r$r$r%�	accesskeyVs
rCc@s6eZdZd	dd�Zdefdd�Zdefdd�ZeZdS)
�idgenrNcCs
d|_dSr'��id��selfr$r$r%�__init__as
zidgen.__init__cCs|jS�NrErGr$r$r%�currentdsz
idgen.currentcCs|jd7_|jS)Nr1rErGr$r$r%�__next__gszidgen.__next__)rN)�__name__�
__module__�__qualname__rIr(rKrL�nextr$r$r$r%rD`s

rD�message�args�kwargscOsPd|vr|�d�|�dd�}d||f}t�d�}|j|g|�Ri|��dS)N�pagename�file_suffixrAzin rendering %s: %sz
sphinx.themes)�getr�	getLogger�warning)r>rQrRrS�filename�loggerr$r$r%rXms
rXc	@s0eZdZdZdededeeeeffdd�ZdS)�SphinxFileSystemLoaderzd
    FileSystemLoader subclass that is not so strict about '..'  entries in
    template names.
    �environment�templaterc	s�|jD]@}t�||��t��}|durq|�|���|j�}Wd�n1s)wYt����dtf��fdd�}|�|fSt	|��)Nrcs&zt����kWStyYdSw)NF)r�getmtime�OSErrorr$�rY�mtimer$r%�uptodate�s
�z3SphinxFileSystemLoader.get_source.<locals>.uptodate)
�
searchpathr�joinr�read�decode�encodingr^r"r)rHr\r]rc�f�contentsrbr$r`r%�
get_source}s
�
z!SphinxFileSystemLoader.get_sourceN)	rMrNrO�__doc__rr r
rrjr$r$r$r%r[ws$r[c	@s�eZdZdZddddedeeddfdd	�Zd
ededefdd
�Z	dededefdd�Z
defdd�Zde
d
edeeeeffdd�ZdS)�BuiltinTemplateLoaderzK
    Interfaces the rendering environment of jinja2 for use in Sphinx.
    N�builderr�theme�dirsrc	sD|r|��}|dd�|D�}n|rt|�}t|�}ng}g}t�jj�|_�jjrA�fdd��jjD�}||dd�<||dd�<||_dd�|D�|_�jj	du}|rWdgng}t
||d�|_t|jj
d<t|jj
d	<t|jj
d
<t|jj
d<tt�|jjd<t|jjd
<tt�|jjd<t|jjd<|r�|j��jj	�dSdS)NcSsg|]}t�|d��qS)z..)rrd)�.0�pr$r$r%�
<listcomp>�sz.BuiltinTemplateLoader.init.<locals>.<listcomp>csg|]	}t��j|��qSr$)rrd�confdir)rp�tp�rmr$r%rr�s�rcSsg|]}t|��qSr$)r[)rp�xr$r$r%rr�szjinja2.ext.i18n)�loader�
extensions�tobool�toint�todim�slice_index�debugrXrCrD)�get_theme_dirsr2r3�config�templates_path�templatepathlen�	pathchain�loaders�app�
translatorrr\r&�filtersr*r.r=rr�globalsrXrCrD�install_gettext_translations)	rHrmrnror��loaderchain�cfg_templates_path�use_i18nrxr$rur%�init�sB

���zBuiltinTemplateLoader.initr]r>cC�|j�|��|�SrJ)r\�get_template�render)rHr]r>r$r$r%r���zBuiltinTemplateLoader.render�sourcecCr�rJ)r\�from_stringr�)rHr�r>r$r$r%�
render_string�r�z#BuiltinTemplateLoader.render_stringcCstt|jd��S)Nz.html)�maxrr�rGr$r$r%�newest_template_mtime�sz+BuiltinTemplateLoader.newest_template_mtimer\c	Cs`|j}|�d�r||jd�}|dd�}|D]}z	|�||�WSty+Yqwt|��)N�!r1)r��
startswithr�rjr)rHr\r]r�rwr$r$r%rj�s
�z BuiltinTemplateLoader.get_source)NN)rMrNrOrkrr	r r�rr�r��floatr�rr
rrjr$r$r$r%rl�s +$rlN)1rk�osr�pprintr�typingrrrrrr	r
r�jinja2rr
r�jinja2.environmentr�jinja2.sandboxr�jinja2.utilsr�sphinx.applicationr�sphinx.themingr�sphinx.utilr�sphinx.util.osutilrr�ImportErrorr�sphinx.buildersrr r"r&r(r*r.r=rCrDrXr[rlr$r$r$r%�<module>s:
(�

 	

https://t.me/RX1948 - 2025