403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/sphinx/transforms/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/transforms/__pycache__/__init__.cpython-39.pyc
a

�abD<�@s�dZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZddl
mZddlmZmZmZddlmZmZddlmZddlmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#ddl$m%Z%m&Z&ddl'm
Z
m(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.m/Z/m0Z0e�r>ddl1m2Z2ddl3m4Z4ddl5m6Z6e(�7e8�Z9hd�Z:Gdd�de�Z;Gdd�de�Z<Gdd�de;�Z=Gdd�de;�Z>Gdd �d e;�Z?Gd!d"�d"e;�Z@Gd#d$�d$e;�ZAejBejCejDejEejFd%�ZGGd&d'�d'e;�ZHGd(d)�d)e;�ZIGd*d+�d+e;�ZJGd,d-�d-e;�ZKGd.d/�d/e;�ZLGd0d1�d1e;�ZMGd2d3�d3e;�ZNGd4d5�d5e�ZOGd6d7�d7ee;�ZPGd8d9�d9e;�ZQGd:d;�d;e;�ZRGd<d=�d=e;�ZSd>eeTefd?�d@dA�ZUdS)Bz�
    sphinx.transforms
    ~~~~~~~~~~~~~~~~~

    Docutils transforms used by Sphinx when reading documents.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
TYPE_CHECKING�Any�Dict�	Generator�List�Optional�Tuple�cast)�nodes)�Element�Node�Text)�	Transform�Transformer)�ContentsFilter)�SmartQuotes)�normalize_language_tag)�
smartchars)�addnodes)�Config)�RemovedInSphinx60Warning)�_�__)�docutils�logging)�new_document)�format_date)�NodeMatcher�apply_source_workaround�is_smartquotable)�Sphinx)�StandardDomain)�BuildEnvironment>�release�today�versionc@sFeZdZdZedd�dd��Zedd�dd��Zeed�d	d
��ZdS)�SphinxTransformz�A base class of Transforms.

    Compared with ``docutils.transforms.Transform``, this class improves accessibility to
    Sphinx APIs.
    r ��returncCs|jjS)z)Reference to the :class:`.Sphinx` object.)�env�app��self�r-�>/usr/lib/python3.9/site-packages/sphinx/transforms/__init__.pyr*7szSphinxTransform.appr"cCs
|jjjS)z3Reference to the :class:`.BuildEnvironment` object.)�document�settingsr)r+r-r-r.r)<szSphinxTransform.envcCs|jjS)z)Reference to the :class:`.Config` object.)r)�configr+r-r-r.r1AszSphinxTransform.configN)	�__name__�
__module__�__qualname__�__doc__�propertyr*r)rr1r-r-r-r.r&0sr&csReZdZUdZejed<dZeded<ddd�dd�Z	dd	��fd
d�Z
�ZS)�SphinxTransformerz#
    A transformer for Sphinx.
    r/Nr"r))r)r(cCs
||_dS�N)r))r,r)r-r-r.�set_environmentOsz!SphinxTransformer.set_environmentr'cs�t|jtj�r:t|jjd�s.|jr.|j|jj_t���nRzBtd�}|jrT|j|j_||j7}||_t���W|jd|_n|jd|_0dS)Nr)�r)	�
isinstancer/r
�hasattrr0r)�super�apply_transformsr)r,r/��	__class__r-r.r>Rs

z"SphinxTransformer.apply_transforms)r2r3r4r5r
r/�__annotations__r)rr9r>�
__classcell__r-r-r?r.r7Gs


r7c@s$eZdZdZdZedd�dd�ZdS)�DefaultSubstitutionszL
    Replace some substitutions if they aren't defined in the document.
    ��N��kwargsr(cKs|tt|jj�}|j�tj�D]X}|d}||vr|j|}|dkrd|sdt|jj	pXt
d�|jjd�}|�t�
||��qdS)N�refnamer$z	%b %d, %Y)�language)�default_substitutions�setr/Zsubstitution_defs�findallr
Zsubstitution_referencer1rZ	today_fmtrrH�replace_selfr
)r,rFZ	to_handle�refrG�textr-r-r.�applyls
�zDefaultSubstitutions.apply�r2r3r4r5�default_priorityrrOr-r-r-r.rCesrCc@s$eZdZdZdZedd�dd�ZdS)�MoveModuleTargetszv
    Move module targets that are the first thing in a section to the section
    title.

    XXX Python specific
    rDNrEcKsnt|j�tj��D]V}|ds qd|vr|jjtjur|j�|�dkr|d|jddd�<|j�	|�qdS)N�idsZismod�r)
�listr/rKr
�target�parentr@�section�index�remove�r,rF�noder-r-r.rO�s��zMoveModuleTargets.applyrPr-r-r-r.rRzsrRc@s$eZdZdZdZedd�dd�ZdS)�HandleCodeBlocksz5
    Several code block related transformations.
    rDNrEcKs8|j�tj�D]$}tdd�|jD��r|�|j�qdS)Ncss|]}t|tj�VqdSr8)r;r
�
doctest_block)�.0�childr-r-r.�	<genexpr>��z)HandleCodeBlocks.apply.<locals>.<genexpr>)r/rKr
Zblock_quote�all�childrenrLr[r-r-r.rO�s
�zHandleCodeBlocks.applyrPr-r-r-r.r]�sr]c@s$eZdZdZdZedd�dd�ZdS)�
AutoNumberingzO
    Register IDs of tables, figures and literal_blocks to assign numbers.
    rDNrEcKsT|j�d�}|j�tj�D]4}|�|�r|�|�dur|dgkr|j�|�qdS)NZstdrS)	r)Z
get_domainr/rKr
rZis_enumerable_nodeZget_numfig_titleZnote_implicit_target)r,rF�domainr\r-r-r.rO�s
�
�zAutoNumbering.applyrPr-r-r-r.re�srec@s$eZdZdZdZedd�dd�ZdS)�SortIdszA
    Sort section IDs so that the "id[0-9]+" one comes last.
    iNrEcKs\|j�tj�D]H}t|d�dkr|dd�d�r|ddd�|ddg|d<qdS)NrSrTr�id)r/rKr
rX�len�
startswithr[r-r-r.rO�s"z
SortIds.applyrPr-r-r-r.rg�srg)z
literal-blockz
doctest-block�rawrY�imagec@s$eZdZdZdZedd�dd�ZdS)�ApplySourceWorkaroundz0
    Update source and rawsource attributes
    �
NrEcKs2|j��D]"}t|tjtjtjf�r
t|�q
dSr8)r/rKr;r
ZTextElementrlZtopicrr[r-r-r.rO�szApplySourceWorkaround.applyrPr-r-r-r.rm�srmc@s$eZdZdZdZedd�dd�ZdS)�AutoIndexUpgraderz[
    Detect old style (4 column based indices) and automatically upgrade to new style.
    rDNrEcKs�|j�tj�D]r}d|vrtdd�|dD��rtd�|d}tj||d�t|d�D]$\}}t	|�dkrZ|d|d|<qZqdS)N�entriescss|]}t|�dkVqdS)�N)ri)r_�entryr-r-r.ra�rbz*AutoIndexUpgrader.apply.<locals>.<genexpr>zG4 column based index found. It might be a bug of extensions you use: %r)�locationrqr8)
r/rKrrY�anyr�logger�warning�	enumerateri)r,rFr\�msg�irrr-r-r.rO�s�zAutoIndexUpgrader.applyrPr-r-r-r.ro�sroc@s$eZdZdZdZedd�dd�ZdS)�ExtraTranslatableNodesz!
    Make nodes translatable
    rnNrEcsX|jj��fdd�t��D���s&dSttd��fdd�}|j�|�D]}d|d<qFdS)Ncsg|]\}}|�vr|�qSr-r-)r_�k�v)�targetsr-r.�
<listcomp>�rbz0ExtraTranslatableNodes.apply.<locals>.<listcomp>�r\r(cst|t���Sr8)r;�tuple�r\)�target_nodesr-r.�is_translatable_node�sz:ExtraTranslatableNodes.apply.<locals>.is_translatable_nodeTZtranslatable)r1Zgettext_additional_targets�TRANSLATABLE_NODES�itemsr�boolr/rK)r,rFr�r\r-)r�r}r.rO�szExtraTranslatableNodes.applyrPr-r-r-r.rz�srzc@s$eZdZdZdZedd�dd�ZdS)�UnreferencedFootnotesDetectorz9
    Detect unreferenced footnotes and emit warnings
    ��NrEcs�|jjD]F��dgkrq�dd|jjvrtjtd��dddd�d�q|jjD]4�t�fdd�|jjD��sXtjtd	�dd�d�qXdS)
N�namesrz Footnote [%s] is not referenced.rMZfootnote)�typeZsubtypersc3s|]}|d�dkVqdS)�autoNr-)r_rMr�r-r.ra
rbz6UnreferencedFootnotesDetector.apply.<locals>.<genexpr>zFootnote [#] is not referenced.)	r/Z	footnotesZ
footnote_refsrurvrZ
autofootnotesrtZautofootnote_refs�r,rFr-r�r.rOs�
�z#UnreferencedFootnotesDetector.applyrPr-r-r-r.r��sr�c@s$eZdZdZdZedd�dd�ZdS)�DoctestTransformz.Set "doctest" style to each doctest_block node��NrEcKs&|j�tj�D]}|d�d�qdS)N�classesZdoctest)r/rKr
r^�appendr[r-r-r.rOszDoctestTransform.applyrPr-r-r-r.r�sr�cs>eZdZdZdZeedd��fdd�Zedd�dd	�Z�ZS)
�
FigureAlignerz-
    Align figures to center by default.
    i�N)�argsrFr(cs"t�dt�t�j|i|��dS)NzFigureAilgner is deprecated.)�warnings�warnrr=�__init__)r,r�rFr?r-r.r�"s�zFigureAligner.__init__rEcKs0ttjtj�}|j�|�D]}|�dd�qdS)NZalign�default)rr
�tableZfigurer/rK�
setdefault)r,rFZmatcherr\r-r-r.rO'szFigureAligner.apply)	r2r3r4r5rQrr�rOrBr-r-r?r.r�sr�c@s$eZdZdZdZedd�dd�ZdS)�FilterSystemMessagesz&Filter system messages from a doctree.��NrEcKsT|jjrdnd}t|j�tj��D],}|d|kr"t�d|�	��|j
�|�q"dS)N���levelz%s [filtered system message])r1Z
keep_warningsrUr/rKr
Zsystem_messageru�debug�astextrWrZ)r,rFZfilterlevelr\r-r-r.rO1s
zFilterSystemMessages.applyrPr-r-r-r.r�-sr�c@s(eZdZdZejZejdd�dd�Z	dS)�SphinxContentsFilterzx
    Used with BuildEnvironment.add_toc_from() to discard cross-file links
    within table-of-contents link nodes.
    NrcCs
tj�dSr8)r
ZSkipNode)r,r\r-r-r.�visit_image@sz SphinxContentsFilter.visit_image)
r2r3r4r5rZ ignore_node_but_process_childrenZvisit_pending_xrefr
rlr�r-r-r-r.r�9sr�cs`eZdZdZdZedd��fdd�Zed�dd	�Ze	e
eee
e
fddfd
�dd�Z�ZS)
�SphinxSmartQuoteszr
    Customized SmartQuotes to avoid transform for some extra node types.

    refs: sphinx.parsers.RSTParser
    i�NrEcs$|��sdS|jj|_t���dSr8)�is_availabler1Zsmartquotes_actionr=rOr�r?r-r.rOLs
zSphinxSmartQuotes.applyr'cCs�|jj�dg�}|jj�dg�}|jjjdur2dS|jjdurBdS|jjj	|vrTdS|jj
|vrddS|jjd}t|�D]}|t
jvrxdSqxdS)N�builders�	languagesFZ
language_codeT)r1Zsmartquotes_excludes�getr/r0Zsmart_quotesZsmartquotesr*Zbuilder�namerHr)rrZquotes)r,r�r�rH�tagr-r-r.r�Us
zSphinxSmartQuotes.is_available)�txtnodesr(ccsV|D]L}t|�rBtjdkr.t�ddt|��}n|��}d|fVqd|��fVqdS)N)r�z(?<=\x00)([-\\\'".`])z\\\1Zplain�literal)rrZ__version_info__�re�sub�strr�)r,r�ZtxtnoderNr-r-r.�
get_tokensns
zSphinxSmartQuotes.get_tokens)r2r3r4r5rQrrOr�r�rr
rrr�r�rBr-r-r?r.r�Ds
	r�c@s$eZdZdZdZedd�dd�ZdS)�DoctreeReadEventz!Emit :event:`doctree-read` event.ipNrEcKs|j�d|j�dS)Nzdoctree-read)r*�emitr/r�r-r-r.rO�szDoctreeReadEvent.applyrPr-r-r-r.r�sr�c@s$eZdZdZdZedd�dd�ZdS)�ManpageLinkz&Find manpage section numbers and namesr�NrEcKsb|j�tj�D]N}d�dd�|jD��}d}||dd�}t�||�}|rP|��}|j	�
|�qdS)N� cSs g|]}t|tj�rt|��qSr-)r;r
r
r�)r_�xr-r-r.r~�s�z%ManpageLink.apply.<locals>.<listcomp>z7^(?P<path>(?P<page>.+)[\(\.](?P<section>[1-9]\w*)?\)?)$r:)�pathZpagerX)r/rKr�manpage�joinrdr��match�	groupdictZ
attributes�update)r,rFr\r��pattern�info�rr-r-r.rO�s�zManpageLink.applyrPr-r-r-r.r��sr�c@s$eZdZdZdZedd�dd�ZdS)�GlossarySorterz.Sort glossaries that have the ``sorted`` flag.r�NrEcKsH|j�tj�D]4}|drttj|d�}t|dd�d�|dd�<qdS)N�sortedrcSs t�dttj|�d�����S)NZNFDr)�unicodedata�	normalizer	r
Ztermr��lower)�itemr-r-r.�<lambda>�s�z&GlossarySorter.apply.<locals>.<lambda>)�key)r/rKr�glossaryr	r
�definition_listr�)r,rFr�r�r-r-r.rO�s�zGlossarySorter.applyrPr-r-r-r.r��sr�r )r*r(cCs�|�t�|�t�|�t�|�t�|�t�|�t�|�t�|�t�|�t	�|�t
�|�t�|�t�|�t
�|�t�|�t�dddd�S)NZbuiltinT)r%Zparallel_read_safeZparallel_write_safe)Z
add_transformrmrzrCrRr]rgr�reror�r�r�r�r�r�)r*r-r-r.�setup�s&














�r�)Vr5r�r�r��typingrrrrrrrr	rr
Zdocutils.nodesrrr
Zdocutils.transformsrrZdocutils.transforms.partsrZdocutils.transforms.universalrZdocutils.utilsrZdocutils.utils.smartquotesrZsphinxrZ
sphinx.configrZsphinx.deprecationrZ
sphinx.localerrZsphinx.utilrZsphinx.util.docutilsrZsphinx.util.i18nrZsphinx.util.nodesrrrZsphinx.applicationr Zsphinx.domain.stdr!Zsphinx.environmentr"Z	getLoggerr2rurIr&r7rCrRr]rergZ
literal_blockr^rkrYrlr�rmrorzr�r�r�r�r�r�r�r�r�r�r�r-r-r-r.�<module>sf
(

�		;

Youez - 2016 - github.com/yon3zu
LinuXploit