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/docutils/transforms/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

OԼaV��@s�dZdZddlZddlZddlmZmZddlmZm	Z	Gdd�de	�Z
Gdd	�d	e	�ZGd
d�de	�ZGdd
�d
e	�Z
Gdd�de	�ZGdd�de	�ZGdd�de�ZGdd�de	�ZGdd�de	�ZGdd�de	�ZGdd�dej�ZdS)z&
Transforms for resolving references.
ZreStructuredText�N)�nodes�utils)�TransformError�	Transformc@seZdZdZdZdd�ZdS)�PropagateTargetsa}
    Propagate empty internal targets to the next element.

    Given the following nodes::

        <target ids="internal1" names="internal1">
        <target anonymous="1" ids="id1">
        <target ids="internal2" names="internal2">
        <paragraph>
            This is a test.

    PropagateTargets propagates the ids and names of the internal
    targets preceding the paragraph to the paragraph itself::

        <target refid="internal1">
        <target anonymous="1" refid="id1">
        <target refid="internal2">
        <paragraph ids="internal2 id1 internal1" names="internal2 internal1">
            This is a test.
    icCs�|j�tj�D�]l}t|jtj�s|�d�s|�d�s|�d�rBqt|�dksVJd��|j	dd�}t|tj
�r~|j	ddd	�}qb|dust|tjtjf�r�t|tj�s�q|d
�
|d
�|d�
|d�t|d�s�i|_t|d
�s�i|_|d
D]}||jj|<||j|<q�|dD]}||j|<�q|j�t|di��|j�t|d
i��|d
d|d<g|d
<g|d<|j�|�qdS)N�refid�refuri�refnamerz&error: block-level target has childrenT)�ascendF)r
Zdescend�ids�names�expect_referenced_by_name�expect_referenced_by_id)�document�findallr�target�
isinstance�parentZTextElement�hasattr�len�	next_nodeZsystem_messageZ	InvisibleZ
Targetable�extendr
rr�update�getattr�
note_refid)�selfrr�id�name�r�B/usr/lib/python3.9/site-packages/docutils/transforms/references.py�apply+sP����
�


�
�zPropagateTargets.applyN��__name__�
__module__�__qualname__�__doc__�default_priorityr rrrrrsrc@seZdZdZdZdd�ZdS)�AnonymousHyperlinksa�
    Link anonymous references to targets.  Given::

        <paragraph>
            <reference anonymous="1">
                internal
            <reference anonymous="1">
                external
        <target anonymous="1" ids="id1">
        <target anonymous="1" ids="id2" refuri="http://external">

    Corresponding references are linked via "refid" or resolved via "refuri"::

        <paragraph>
            <reference anonymous="1" refid="id1">
                text
            <reference anonymous="1" refuri="http://external">
                external
        <target anonymous="1" ids="id1">
        <target anonymous="1" ids="id2" refuri="http://external">
    i�c
CsPg}g}|j�tj�D]}|�d�r|�|�q|j�tj�D]}|�d�r>|�|�q>t|�t|�kr�|jj�	dt|�t|�f�}|j�
|�}|D]8}tj|j|j|d�}|j�
|�}|�
|�|�|�q�dSt||�D]l\}}	d|	_|	�d��r|	d|d<d|_q�q�|	d�s*|jj|	d}	q�|	dd|d<|j�|�q�q�q�dS)	N�	anonymousz]Anonymous hyperlink mismatch: %s references but %s targets.
See "backrefs" attribute for IDs.�r�rrrr)rrr�	reference�get�appendrr�reporter�error�set_id�problematic�	rawsource�add_backref�replace_self�zip�
referencedr�resolvedrr)
rZanonymous_refsZanonymous_targets�node�msg�msgid�ref�prb�prbidrrrrr vsJ

���
�

zAnonymousHyperlinks.applyNr!rrrrr'\sr'c@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�IndirectHyperlinksaN
    a) Indirect external references::

           <paragraph>
               <reference refname="indirect external">
                   indirect external
           <target id="id1" name="direct external"
               refuri="http://indirect">
           <target id="id2" name="indirect external"
               refname="direct external">

       The "refuri" attribute is migrated back to all indirect targets
       from the final direct target (i.e. a target not referring to
       another indirect target)::

           <paragraph>
               <reference refname="indirect external">
                   indirect external
           <target id="id1" name="direct external"
               refuri="http://indirect">
           <target id="id2" name="indirect external"
               refuri="http://indirect">

       Once the attribute is migrated, the preexisting "refname" attribute
       is dropped.

    b) Indirect internal references::

           <target id="id1" name="final target">
           <paragraph>
               <reference refname="indirect internal">
                   indirect internal
           <target id="id2" name="indirect internal 2"
               refname="final target">
           <target id="id3" name="indirect internal"
               refname="indirect internal 2">

       Targets which indirectly refer to an internal target become one-hop
       indirect (their "refid" attributes are directly set to the internal
       target's "id"). References which indirectly refer to an internal
       target become direct internal references::

           <target id="id1" name="final target">
           <paragraph>
               <reference refid="id1">
                   indirect internal
           <target id="id2" name="indirect internal 2" refid="id1">
           <target id="id3" name="indirect internal" refid="id1">
    i�cCs,|jjD]}|js|�|�|�|�qdS�N)rZindirect_targetsr7�resolve_indirect_target�resolve_indirect_references�rrrrrr �s
zIndirectHyperlinks.applycCsL|�d�}|dur|d}n<|jj�|�}|sX|jjjD]}||�r8qTq8|�|�dS|jj|}|j|d�t|t	j
�r�|js�|�d�r�t|d�r�|�
|�dSd|_|�|�|`|�d�r�|d|d<d|vr�|d=nT|�d��r|d|d<|j�|�n.|d�r$||d<|j�|�n|�|�dS|du�rB|d=d|_dS)Nr	r�r�multiply_indirectr*rr)r,r�nameids�transformer�unknown_reference_resolvers�nonexistent_indirect_targetr�note_referenced_byrrrr7r�circular_indirect_referencerDr@r)rrr	Zreftarget_id�resolver_functionZ	reftargetrrrr@�sN

�
��






z*IndirectHyperlinks.resolve_indirect_targetcCs.|d|jjvr|�|d�n|�|d�dS)Nr	z>which is a duplicate, and cannot be used as a unique referencezwhich does not exist)rrE�indirect_target_errorrBrrrrHsz.IndirectHyperlinks.nonexistent_indirect_targetcCs|�|d�dS)Nzforming a circular reference)rLrBrrrrJsz.IndirectHyperlinks.circular_indirect_referencecCs�d}g}|dr d|dd}|dD]}|�|jj�|g��q(|dD]}|�|jj�|g��qL|dr�|d|dd7}|jjjd||d|f|d	�}|j�|�}t�	|�D]8}	t
j|	j|	j|d
�}
|j�|
�}|�
|�|	�|
�q�d|_dS)N�rz"%s" rrz	(id="%s")z7Indirect hyperlink target %s refers to target "%s", %s.r	��	base_noder)r*)rr�refnamesr,�refidsr.r/r0rZuniqrr1r2r3r4r7)rrZexplanation�naming�reflistrrr9r:r;r<r=rrrrLs2��
�
z(IndirectHyperlinks.indirect_target_errorc	Cs*|�d�rd}|jj}n|�d�r,d}d}ndS||}|dD]l}|jj�|g�}|rd|j|d�|D]B}|jrtqh|d=|||<|r�||�d|_t|tj	�rh|�
|�qhq@|dD]n}|jj�|g�}|r�|j|d�|D]D}|jr�q�|d=|||<|�r||�d|_t|tj	�r�|�
|�q�q�dS)	Nrrr�rr	r*rrC)rrrrPr,rIr7rrrrArQ)	rrZattnameZcall_methodZattvalrrSr;rrrrrA(sH


z.IndirectHyperlinks.resolve_indirect_referencesN)r"r#r$r%r&r r@rHrJrLrArrrrr>�s2-r>c@seZdZdZdZdd�ZdS)�ExternalTargetsa�
    Given::

        <paragraph>
            <reference refname="direct external">
                direct external
        <target id="id1" name="direct external" refuri="http://direct">

    The "refname" attribute is replaced by the direct "refuri" attribute::

        <paragraph>
            <reference refuri="http://direct">
                direct external
        <target id="id1" name="direct external" refuri="http://direct">
    i�cCs~|j�tj�D]j}|�d�r|d}|dD]J}|jj�|g�}|rP|j|d�|D] }|jr`qT|d=||d<d|_qTq,qdS)NrrrTr	r*)	rrrrrrPr,rIr7)rrrrrSr;rrrr ds
zExternalTargets.applyNr!rrrrrUPsrUc@s eZdZdZdd�Zdd�ZdS)�InternalTargetsi�cCs6|j�tj�D]"}|�d�s|�d�s|�|�qdS)Nrr)rrrrr�resolve_reference_idsrBrrrr xszInternalTargets.applycCsj|dD]\}|jj�|�}|jj�|g�}|r:|j|d�|D]$}|jrJq>|r\|d=||d<d|_q>qdS)a�
        Given::

            <paragraph>
                <reference refname="direct internal">
                    direct internal
            <target id="id1" name="direct internal">

        The "refname" attribute is replaced by "refid" linking to the target's
        "id"::

            <paragraph>
                <reference refid="id1">
                    direct internal
            <target id="id1" name="direct internal">
        rrTr	rr*N)rrEr,rPrIr7)rrrrrSr;rrrrW}sz%InternalTargets.resolve_reference_idsN)r"r#r$r&r rWrrrrrVtsrVc@sPeZdZdZdZdZgd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�ZdS)�	Footnotesa�
    Assign numbers to autonumbered footnotes, and resolve links to footnotes,
    citations, and their references.

    Given the following ``document`` as input::

        <document>
            <paragraph>
                A labeled autonumbered footnote reference:
                <footnote_reference auto="1" id="id1" refname="footnote">
            <paragraph>
                An unlabeled autonumbered footnote reference:
                <footnote_reference auto="1" id="id2">
            <footnote auto="1" id="id3">
                <paragraph>
                    Unlabeled autonumbered footnote.
            <footnote auto="1" id="footnote" name="footnote">
                <paragraph>
                    Labeled autonumbered footnote.

    Auto-numbered footnotes have attribute ``auto="1"`` and no label.
    Auto-numbered footnote_references have no reference text (they're
    empty elements). When resolving the numbering, a ``label`` element
    is added to the beginning of the ``footnote``, and reference text
    to the ``footnote_reference``.

    The transformed result will be::

        <document>
            <paragraph>
                A labeled autonumbered footnote reference:
                <footnote_reference auto="1" id="id1" refid="footnote">
                    2
            <paragraph>
                An unlabeled autonumbered footnote reference:
                <footnote_reference auto="1" id="id2" refid="id3">
                    1
            <footnote auto="1" id="id3" backrefs="id2">
                <label>
                    1
                <paragraph>
                    Unlabeled autonumbered footnote.
            <footnote auto="1" id="footnote" name="footnote" backrefs="id1">
                <label>
                    2
                <paragraph>
                    Labeled autonumbered footnote.

    Note that the footnotes are not in the same order as the references.

    The labels and reference text are added to the auto-numbered ``footnote``
    and ``footnote_reference`` elements.  Footnote elements are backlinked to
    their references via "refids" attributes.  References are assigned "id"
    and "refid" attributes.

    After adding labels and reference text, the "auto" attributes can be
    ignored.
    ilN)
�*u†u‡�§�¶�#u♠u♥u♦u♣cCs:g|_|jj}|�|�|j_|�|�|��|��dSr?)�autofootnote_labelsrZautofootnote_start�number_footnotes�number_footnote_references�symbolize_footnotes�resolve_footnotes_and_citations)r�startnumrrrr �s
zFootnotes.applycCs|jjD�]
}t|�}|d7}||jjvrq.q|�dt�d|��|dD]�}|jj�|g�D]z}|t�	|�7}|�
d�t|d�t|d�kr�dks�nJ�|dd|d<|�|dd�|j�
|�d|_q^qJ|ds|ds|d�|�|j�||�|j�|�q|S)	z�
        Assign numbers to autonumbered footnotes.

        For labeled autonumbered footnotes, copy the number over to
        corresponding footnote references.
        r*rrMrr	rrZdupnames)rZ
autofootnotes�strrE�insertr�label�
footnote_refsr,�Text�delattrrr3rr7r-�note_explicit_targetr])rrb�footnotererr;rrrr^�s(
*
zFootnotes.number_footnotesc
CsHd}|jjD�]4}|js|�d�r$qz|j|}Wn�ty�|jjjdt|j�|d�}|j�	|�}|jj|d�D]J}|jsx|�d�r�qxt
j|j|j|d�}|j�	|�}|�
|�|�|�qxY�qDYn0|t
�|�7}|jj|}	|jj|	}
|	|d<|j�|�t|d�d	k�s"J�|
�
|dd�d	|_|d	7}qdS)
z3Assign numbers to autonumbered footnote references.rrzUToo many autonumbered footnote references: only %s corresponding footnotes available.rNNr	r)rr*)rZautofootnote_refsr7rr]�
IndexErrorr.r/rr0rr1r2r3r4rgrErr)rrb�ir;rer9r:r<r=rrjrrrr_sB��
�
z$Footnotes.number_footnote_referencesc
Cs�g}|jjD]h}t|jjt|j��\}}|j||d}|�|�|�dt�	d|��|jjd7_|j�
|�qd}|jjD�]}z|t�||�7}Wn�t
�y<|jjjdt|�|d�}|j�
|�}	|jj|d�D]J}|js�|�d�r�q�tj|j|j|	d�}
|j�
|
�}|�|�|�|
�q�Y�q�Yn0|jj|}t|d	�dk�s`J�|d	d|d<|j�|�|�|d	d�|d7}q�dS)
z<Add symbols indexes to "[*]"-style footnotes and references.r*rrMzOToo many symbol footnote references: only %s corresponding footnotes available.rNNrr)r)rZsymbol_footnotes�divmodZsymbol_footnote_startr�symbolsr-rdrrer0Zsymbol_footnote_refsrgrkr.r/r7rr1r2r3r4r)r�labelsrjZreps�indexZ	labeltextrlr;r9r:r<r=rrrr`5sL�
��
�
zFootnotes.symbolize_footnotescCs�|jjD]6}|dD](}||jjvr|jj|}|�||�qq|jjD]6}|dD](}||jjvrT|jj|}|�||�qTqHdS)za
        Link manually-labeled footnotes and citations to/from their
        references.
        rN)rZ	footnotesrf�resolve_referencesZ	citationsZ
citation_refs)rrjrerSZcitationrrrraZsz)Footnotes.resolve_footnotes_and_citationscCszt|d�dksJ�|dd}|D]J}|jr0q$|�d�||d<t|d�dksVJ�|�|dd�d|_q$d|_dS)Nrr*rr	r)rr7rhr3)rZnoterSrr;rrrrqjs
zFootnotes.resolve_references)
r"r#r$r%r&r]rnr r^r_r`rarqrrrrrX�s;!%rXc@seZdZdS)�#CircularSubstitutionDefinitionErrorN)r"r#r$rrrrrrx�rrc@seZdZdZdZdd�ZdS)�
SubstitutionsaD
    Given the following ``document`` as input::

        <document>
            <paragraph>
                The
                <substitution_reference refname="biohazard">
                    biohazard
                 symbol is deservedly scary-looking.
            <substitution_definition name="biohazard">
                <image alt="biohazard" uri="biohazard.png">

    The ``substitution_reference`` will simply be replaced by the
    contents of the corresponding ``substitution_definition``.

    The transformed result will be::

        <document>
            <paragraph>
                The
                <image alt="biohazard" uri="biohazard.png">
                 symbol is deservedly scary-looking.
            <substitution_definition name="biohazard">
                <image alt="biohazard" uri="biohazard.png">
    ��c
Cs0|jj}|jj}i}t|jjdd�}t|j�tj��}|D�]�}d}|d}||vrZ|}	n|�	�}
|�
|
d�}	|	dur�|jjjd||d�}n*||	}t
|���|kr�|jj�d|	�}|r�|j�|�}tj|j|j|d�}
|j�|
�}|�|�|�|
�q:|j}|�|�}d	|jv�s&d
|jv�r^|dk�r^t||dtj��r^||d��||d<d
|jv�svd
|jv�r�t
|�|dk�r�t||dtj��r�||d��||d<|��}z^|�tj�D]L}||d�	�}||�|g�v�r�t�||�|	�||d<|�|��q�Wn�t�y�|j}t|tj��rp|jjjdt� |j|j�|j!|d�}|�|�nr|}|�"d��r�|d}�qt|jjjd||d�}|j�|�}tj|j|j|d�}
|j�|
�}|�|�|�|
�Yq:Yn0|�|j#�|j#D]*}t|tj$��r�d|v�r�|j�%|��q�q:dS)N�line_length_limiti'rMr	z(Undefined substitution referenced: "%s".rNz;Substitution definition "%s" exceeds the line-length-limit.r)ZltrimZtrimrr*Zrtrimz
ref-originz*Circular substitution definition detected:)�linerOz2Circular substitution definition referenced: "%s".)&rZsubstitution_defsZsubstitution_namesr�settings�listrrZsubstitution_reference�lowerr,r.r/rZastextr0r1r2r3r4rrpZ
attributesrrg�rstrip�lstripZdeepcopy�
setdefaultrrr-Zsubstitution_definitionZ
literal_blockrwrZchildrenZReferentialZnote_refname)rZdefs�normed�nestedrvZ
subreflistr;r9r	�keyZnormed_nameZsubdefr:r<r=rrpZsubdef_copyZ
nested_refZnested_nameZ
ref_originr8rrrr �s��
����
�


���������
�




zSubstitutions.applyNr!rrrrrt{srtc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�TargetNotesz�
    Creates a footnote for each external target in the text, and corresponding
    footnote references after each reference.
    icCs$tj|||d�|j�dg�|_dS)N)�	startnode�class)r�__init__Zdetailsr,�classes)rrr�rrrr�szTargetNotes.__init__c	Cs�i}g}|j�tj�D]v}|�d�s&q|d}g}|D]}|�|jj�|g��q6|sXq|�|d||�}|d|vr|||d<|�	|�q|j�tj
�D]P}|�d�s�q�|�d�r�|�|d|g|�}|d|vr�|||d<|�	|�q�|j�|�dS)Nrrr()
rrrrrrrPr,�make_target_footnoter-r+r�r4)	r�notesZnodelistrr�refsrrjr;rrrr 	s8
�

�zTargetNotes.applycCsZ||vr2||}t|d�dks$J�|dd}nlt��}|j�|�}d|}d|d<|g|d<t��}|tjd||d�7}||7}|j�|�|j�||�|D]�}t	|tj
�r�q�tj|dd�}	|	d	|j7<|j�
|	�|j�|	�|j�|�d}
|	g}t�|jj��sF|j�r4|�dtjd
|jd��n|�dt�d
��|j�|
|�q�|S)Nrr*rz
TARGET_NOTE: �autorM)r)r	r�r�� )�textZClasses)rrrjrr0Z	paragraphr+Znote_autofootnoterirrZfootnote_referencer�Znote_autofootnote_refZnote_footnote_refrrprZget_trim_footnote_ref_spacerxrdZinlinerg)rrr�r�rjZ
footnote_nameZfootnote_idZfootnote_paragraphr;ZrefnoderprSrrrr�'s:
z TargetNotes.make_target_footnoteN)r"r#r$r%r&r�r r�rrrrr��s
r�c@seZdZdZdZdd�ZdS)�DanglingReferencesze
    Check for dangling references (incl. footnote & citation) and for
    unreferenced targets.
    iRcCs�t|j|jjj�}|j�|�|j�tj�D]`}|js,|�	d�rBq,|drX|dd}n|drn|dd}n|d}|jj
jd||d�q,dS)Nr(rrrrz(Hyperlink target "%s" is not referenced.rN)�DanglingReferencesVisitorrrFrG�walkrrrr6r,r.�info)rZvisitorrrRrrrr Ts(�
��zDanglingReferences.applyNr!rrrrr�Ksr�c@s,eZdZdd�Zdd�Zdd�ZeZZdS)r�cCstj�||�||_||_dSr?)r�SparseNodeVisitorr�rrG)rrrGrrrr�rsz"DanglingReferencesVisitor.__init__cCsdSr?r)rr8rrr�
unknown_visitwsz'DanglingReferencesVisitor.unknown_visitc	Cs|js|�d�sdS|d}|jj�|�}|dur�|jD]}||�r8q�q8||jjvrr|jjjd|d|d�}n|jjjd|d|d�}|j�|�}t	j
|j|j|d�}z|dd}Wnty�|j�|�}Yn0|�
|�|�|�n(|d=||d<|jj|j|d	�d
|_dS)Nr	zBDuplicate target name, cannot be used as a unique reference: "%s".rNzUnknown target name: "%s".r)rrrrCr*)r7rrrEr,rGr.r/r0rr1r2rkr3r4rrI)	rr8r	rrKr9r:r<r=rrr�visit_referencezsB
��
�
�
z)DanglingReferencesVisitor.visit_referenceN)r"r#r$r�r�r�Zvisit_footnote_referenceZvisit_citation_referencerrrrr�ps!r�)r%Z
__docformat__�sys�reZdocutilsrrZdocutils.transformsrrrr'r>rUrVrX�	Exceptionrrrtr�r�r�r�rrrr�<module>s$JB3$(]}S%

Youez - 2016 - github.com/yon3zu
LinuXploit