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/util/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/nodes.cpython-39.opt-1.pyc
a

�ab�[�"@s(dZddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlmZddlmZmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZer�ddl m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'e�(e)�Z*e�+dej,�Z-e-Z.Gdd�d�Z/ee0d�dd�Z1d|ee2e0d�dd�Z3edd�dd�Z4ej5ej6ej7ej8fZ9ee:d�dd�Z;ee:d�dd�Z<ej6ej7ej=ej>fZ?ej@fZAejBfZCeeeee0fd �d!d"�ZDee	e0d�d#d$�ZEee	e2d�d%d&�ZFd}eeeed'�d(d)�ZGee	ed�d*d+�ZHeeeeed,fd �d-d.�ZIeeee0d/�d0d1�ZJee0d�d2d3�ZKe0ee:e0e0fd4�d5d6�ZLgd7�ZMe0e0eee0e0e0e0e	e0fd8�d9d:�ZNd;e
e0e0ejOeee0ejOd<�d=d>�ZPe0e0d?�d@dA�ZQe�+dB�ZRe�+dC�ZSdDdEdFdGdHdIdJdJdKdEdLdMdHdNdOdIdIdPdQdRdQdHdNdIdSdKdTdQdUdSdVdWdPdX�!ZTdYdZd[d\d]d^�ZUd~d`ejOe0e0e0da�dbdc�ZVejWe0e	edd�dedf�ZXdd;e0e0e0e
eeefe0ejYdg�dhdi�ZZeeddj�dkdl�Z[ee2eddm�dndo�Z\eeddp�dqdr�Z]ej^ej_ej`ej@ej>ejaejbfZcee:d�dsdt�Zdeduddv�dwdx�Zeeedy�dzd{�Zfefej_gdS)�z�
    sphinx.util.nodes
    ~~~~~~~~~~~~~~~~~

    Docutils node-related utility functions for Sphinx.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
TYPE_CHECKING�Any�Callable�Iterable�List�Optional�Set�Tuple�Type�Union�cast)�nodes)�Element�Node)�	Directive)�Inliner)�
StringList)�addnodes)�__)�logging)�Builder)�
IndexEntry)�BuildEnvironment)�Tagsz^(.+?)\s*(?<!\x00)<([^<]*?)>$c@sFeZdZdZeeedd�dd�Zeed�dd�Z	eed�d	d
�Z
dS)�NodeMatchera"A helper class for Node.findall().

    It checks that the given node is an instance of the specified node-classes and
    has the specified node-attributes.

    For example, following example searches ``reference`` node having ``refdomain``
    and ``reftype`` attributes::

        matcher = NodeMatcher(nodes.reference, refdomain='std', reftype='citation')
        doctree.findall(matcher)
        # => [<reference ...>, <reference ...>, ...]

    A special value ``typing.Any`` matches any kind of node-attributes.  For example,
    following example searches ``reference`` node having ``refdomain`` attributes::

        from typing import Any
        matcher = NodeMatcher(nodes.reference, refdomain=Any)
        doctree.findall(matcher)
        # => [<reference ...>, <reference ...>, ...]
    N)�node_classes�attrs�returncOs||_||_dS�N)�classesr)�selfrr�r!�5/usr/lib/python3.9/site-packages/sphinx/util/nodes.py�__init__>szNodeMatcher.__init__��nodercCs�z||jrt||j�sWdS|jrxt|tj�s2WdS|j��D]:\}}||vrTWdS|tur`q<q<|�|�|kr<WdSq<WdSty�YdS0dS)NFT)	r�
isinstancerr
r�itemsr�get�	Exception)r r%�key�valuer!r!r"�matchBs 
zNodeMatcher.matchcCs
|�|�Sr)r,)r r%r!r!r"�__call__XszNodeMatcher.__call__)�__name__�
__module__�__qualname__�__doc__r
rrr#�boolr,r-r!r!r!r"r(srr$cCsd�|j|jj�S)z�
    Return full module dotted path like: 'docutils.nodes.paragraph'

    :param nodes.Node node: target node
    :return: full module dotted path
    z{}.{})�formatr/�	__class__r.�r%r!r!r"�get_full_module_name\sr6�P)r%�lengthrcCsPz|����}Wnty*t|�}Yn0|rLt|�|krL|d|�d}|S)a�
    return DOM XML representation of the specified node like:
    '<paragraph translatable="False"><inline classes="versionmodified">New in version...'

    :param nodes.Node node: target node
    :param int length:
       length of return value to be striped. if false-value is specified, repr_domxml
       returns full of DOM XML representation.
    :return: DOM XML representation
    Nz...)ZasdomZtoxmlr)�str�len)r%r8�textr!r!r"�repr_domxmlfsr<cCs0t|tj�rN|jsNt�dt|�t|��|j}|j	|_	|j
d|_
|��|_nt|tj�rj|j	sj|jj	|_	t|tj�r�|j	dur�t�dt|�t|��|jj	|jj
|_	|_
t|tj
�r�|j	dur�t�dt|�t|��|jj	|jj
|_	|_
t|tj��rPt�dt|�t|��tt|j�tj���D]&}t�dt�|���d|j�|_�q(t|tj��r�|j	du�r�t�dt|�t|��|jj	|jj
|_	|_
t|tj��r�|j	du�r�t|�|_	|j�s�|��|_|j	�r�|j�r�dSt|tjtj
tjtjf��r,t�dt|�t|��t|��pd|_	d	|_
dSdS)
Nz7[i18n] PATCH: %r to have source, line and rawsource: %s�z)[i18n] PATCH: %r to have source, line: %sz#[i18n] PATCH: %r to have source: %sz&[i18n] PATCH: %r to have rawsource: %sz	\s*:\s*%s�z,[i18n] PATCH: %r to have source and line: %sr)r&r
�
classifier�	rawsource�logger�debugr6r<�parent�source�line�astext�image�title�term�reversed�list�findall�re�sub�escapeZtopic�
literal_block�get_node_sourceZrubric�
field_name)r%Zdefinition_list_itemr?r!r!r"�apply_source_workaroundzsf�
����
�

��rScCs4t|tj�r,t|j�ddg�dtj�r,dSdSdS)Nr
rTF)r&r
�pending�detailsr(r�metar5r!r!r"�is_pending_meta�s
�rWcCs:t|tj�rdSt|tj�r4|�d�s0|�d�r4dSt|tj�rLd|vrLdSt|tj��r|jszt	�
dt|�t|��dSt|t
�r�d|vr�t	�
dt|�t|��dS|�dd�s�t	�
dt|�t|��dSt|tj��r|jdd	k�rt	�
d
t|�t|��dSdSt|��s t|tj��r$dSt|tj��r6dSdS)NT�translatable�altFz)[i18n] SKIP %r because no node.source: %szO[i18n] SKIP %r because node is in IGNORED_NODES and no node['translatable']: %sz3[i18n] SKIP %r because not node['translatable']: %srZorphanz&[i18n] SKIP %r because orphan node: %s)r&rrXr
rGr(ZInlineZTextElementrDrArBr6r<�
IGNORED_NODESrR�childrenrWrV�
docutils_metar5r!r!r"�is_translatable�sB ����r])�doctreerccs|�t�D]�}t|tj�r4|��D]}||fVq"q
t|t�rR|j}|s�|��}n�t|t	j
�r�|�d�rv||dfV|�d�r�d|d}q�d}n`t|t�r�|j
}nNt|t	j�r�t|�r�|jddj
}n(t|tj�r�|d}n|j�d	d
���}|r
||fVq
dS)z3Extract translatable messages from a document tree.rYrXz
.. image:: %sZurir>r
r�content�
� N)rLr]r&rrXZextract_original_messages�LITERAL_TYPE_NODESr@rFr
rGr(�META_TYPE_NODESZ
rawcontentrTrWrUr\�replace�strip)r^r%�msgr!r!r"�extract_messagess0





rgcCs"t|�D]}|jr|jSqdSr)�traverse_parentrD�r%Zpnoder!r!r"rQ'srQcCs"t|�D]}|jr|jSqdSr)rhrErir!r!r"�
get_node_line.srj)r%�clsrccs(|r$|dust||�r|V|j}qdSr)r&rC)r%rkr!r!r"rh5srhcCs*|j�|�}|dkr"|j|dSdSdS)Nrr=)rC�index)r%�posr!r!r"�
get_prev_node<srnrccsFttjdd�}|�|�D](}d|vr.|d}n|d}||fVqdS)z6Traverse translatable index node from a document tree.F)ZinlineZraw_entries�entriesN)rrrlrL)r^Zmatcherr%ror!r!r"�traverse_translatable_indexDs
rp)�stater_r%rcCs\|jj}|jj}g|j_d|j_z$|j|d|dd�W||j_||j_S||j_||j_0dS)z�Version of state.nested_parse() that allows titles and does not require
    titles to have the same decoration as the calling document.

    This is useful when the parsed content comes from a completely different
    context, such as docstrings.
    rr=)Zmatch_titlesN)�memoZtitle_stylesZ
section_levelZnested_parse)rqr_r%Zsurrounding_title_stylesZsurrounding_section_levelr!r!r"�nested_parse_with_titlesOs��rscCsL|��}|�tj�D]}d|d<qt|�tj��D]}|j�|�q2|��S)z&Like node.astext(), but ignore images.r>rY)	�deepcopyrLr
rGrK�rawrC�removerF)r%Zimgrur!r!r"�clean_astextbs
rw)r;rcCs.t�|�}|r$d|�d�|�d�fSd||fS)z3Split role content into title and target, if given.Tr=�F)�explicit_title_rer,�group)r;r,r!r!r"�split_explicit_titlels
r{)�single�pair�doubleZtripleZseeZseealso)�entry�targetidrcCsJddlm}g}|��}|}d}|�d�r>d}|dd���}|D]T}|�|d�rB|t|�dd���}||d|}|�d	|||df��qFqBtD]P}|�|d�r�|t|�dd���}|d
kr�d	}|�||||df��qFq�|�d�D]L}|��}d}|�d��r(d}|dd���}|�s0q�|�d|||df�q�|S)
Nr)�pairindextypesr>�!�mainr=�:z; r}r~�,r|)	Zsphinx.domains.pythonr�re�
startswith�lstripr:�append�
indextypes�split)rr�r�ZindexentriesZoentryr��typer+r!r!r"�process_index_entryys>
r�r)�builder�
docnameset�docname�tree�	colorfunc�	traversedrc

Csttj|���}t|�tj��D]�}g}tt	|d�}|D]�}	|	|vr:zH|�
|	�tj||	�ddd�t
|||	|j�|	�||�}
|�|	�Wn&ty�tjtd�|	|d�Yq:0tj|	d�}|
j|_|�tj�D]}d|vr�|	|d<q�|�
|�q:|j�||�q |S)	zwInline all toctrees in the *tree*.

    Record all docnames in *docnameset*, and output docnames with *colorfunc*.
    �includefilesraT)Znonlz+toctree contains ref to nonexisting file %r��location)r�r�)rr
�documentrtrKrLrZtoctree�mapr9r�rA�info�inline_all_toctrees�envZget_doctree�addr)�warningrZ
start_of_filer[�sectionrCrd)
r�r�r�r�r�r�ZtoctreenodeZnewnodesr�ZincludefileZsubtreeZsofZsectionnoder!r!r"r��s4

�
�
r�)�stringrcCsX|�t�}|�t�}t�d|��dd��d�}t�dd�	|�
���}t�d|�}t|�S)a�Convert `string` into an identifier and return it.

    This function is a modified version of ``docutils.nodes.make_id()`` of
    docutils-0.16.

    Changes:

    * Allow to use capital alphabet characters
    * Allow to use dots (".") and underscores ("_") for an identifier
      without a leading character.

    # Author: David Goodger <goodger@python.org>
    # Maintainer: docutils-develop@lists.sourceforge.net
    # Copyright: This module has been placed in the public domain.
    ZNFKD�ascii�ignore�-rar>)
�	translate�_non_id_translate_digraphs�_non_id_translate�unicodedata�	normalize�encode�decode�
_non_id_charsrN�joinr��_non_id_at_endsr9)r��idr!r!r"�_make_id�s

r�z[^a-zA-Z0-9._]+z^[-0-9._]+|-+$�o�d�h�i�l�t�b�c�f�k�n�p�y�z�g�j�s�e�q�r)!�ii'i1iBigi�i�i�i�i�i�i�i�i�i�i�i�i�i�i%i4i5i6i7i<i?i@iGiIiKiMiOZszZaeZoeZdbZqp)����iSi8i9r>r)r�r��prefixrIrcCs�d}|r|d}n|jjpdd}|rD|rDt||�}||kr\d}n|r\t|�}|dkr\d}|dusn||jvr~||�|�}q\|S)z>Generate an appropriate node_id for given *prefix* and *term*.Nz-%sr�z%sr>)ZsettingsZ	id_prefixr�ZidsZnew_serialno)r�r�r�rIZnode_idZidformatr!r!r"�make_ids
r�)r%�	conditionrcCs0|D]&}t|tj�r|�d�|kr|SqdS)zBPick matched pending_xref_condition node up from the pending_xref.r�N)r&rZpending_xref_conditionr()r%r�Zsubnoder!r!r"�find_pending_xref_condition%s�
r�)r��fromdocname�	todocnamer��childrHrcCsltjdddd�}||kr&|r&||d<n.|rD|�||�d||d<n|�||�|d<|r`||d<||7}|S)z$Shortcut to create a reference node.r>T)ZinternalZrefid�#ZrefuriZreftitle)r
�	referenceZget_relative_uri)r�r�r�r�r�rHr%r!r!r"�make_refnode0s

��
r�)�	directiver%rcCs|j�|j�\|_|_dSr)Z
state_machine�get_source_and_line�linenorDrE)r�r%r!r!r"�set_source_infoBs�r�)�inlinerr�r%rcCs|j�|�\|_|_dSr)Zreporterr�rDrE)r�r�r%r!r!r"�set_role_source_infoGsr�)�src�dstrcCst|�|_t|�|_dSr)rQrDrjrE)r�r�r!r!r"�copy_source_infoKs
r�cCsNt|j�D]*}t|t�rdS|�dd�dur
dSq
t|dd�durJdSdS)z0Check whether the node is smart-quotable or not.FZsupport_smartquotesNT)rhrCr&�NON_SMARTQUOTABLE_PARENT_NODESr(�getattrrir!r!r"�is_smartquotable[s
r�r)r��tagsrcCs�|�tj�D]�}z|�|d�}WnLtyn}z4tjtd�||d�|�|j	pVt
���WYd}~qd}~00|r�|�|j	p�t
���q|�t
���qdS)z0Filter ``only`` nodes which do not match *tags*.�exprz8exception while evaluating only directive expression: %sr�N)rLrZonlyZeval_conditionr)rAr�rZreplace_selfr[r
Zcomment)r�r�r%�ret�errr!r!r"�process_only_nodesis�*r�)r rcCs6|j|jfi|j��}t|tj�r2|j|_|j|_|S)z�monkey-patch Element.copy to copy the rawsource and line
    for docutils-0.16 or older versions.

    refs: https://sourceforge.net/p/docutils/patches/165/
    )r4r@Z
attributesr&r
rrDrE)r Znewnoder!r!r"�	_new_copy}s
r�)r7)N)r>N)N)hr1rMr��typingrrrrrrrr	r
rrZdocutilsr
Zdocutils.nodesrrZdocutils.parsers.rstrZdocutils.parsers.rst.statesrZdocutils.statemachinerZsphinxrZ
sphinx.localerZsphinx.utilrZsphinx.buildersrZ
sphinx.domainrZsphinx.environmentrZsphinx.util.tagsrZ	getLoggerr.rA�compile�DOTALLryZcaption_ref_rerr9r6�intr<rSZ	InvisiblerPZ
doctest_blockZversionmodifiedrZr2rWr]Z
math_blockrurbrGZIMAGE_TYPE_NODESrVrcrgrQrjrhrnrprsrwr{r�r�r�r�r�r�r�r�r�r�Zpending_xrefr�r�r�r�r�r�ZFixedTextElement�literalZmathZproblematicZnot_smartquotabler�r�r�r��copyr!r!r!r"�<module>s�
4
4
?�	.���# 
�'
�"

�$�
����
��

Youez - 2016 - github.com/yon3zu
LinuXploit