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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�ab��@sdZddlZddlZddlmZmZmZmZddlm	Z	m
Z
ddlmZm
Z
ddlmZddlZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZe�e �Z!Gdd�de�Z"e#e#e#ed�dd�Z$edd�dd�Z%eee#efd�dd�Z&dS)a�
    sphinx.ext.extlinks
    ~~~~~~~~~~~~~~~~~~~

    Extension to save typing and prevent hard-coding of base URLs in the reST
    files.

    This adds a new config value called ``extlinks`` that is created like this::

       extlinks = {'exmpl': ('https://example.invalid/%s.html', caption), ...}

    Now you can use e.g. :exmpl:`foo` in your documents.  This will create a
    link to ``https://example.invalid/foo.html``.  The link caption depends on
    the *caption* value given:

    - If it is ``None``, the caption will be the full URL.
    - If it is a string, it must contain ``%s`` exactly once.  In this case the
      caption will be *caption* with the role content substituted for ``%s``.

    You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`.

    Both, the url string and the caption string must escape ``%`` as ``%%``.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Any�Dict�List�Tuple)�nodes�utils)�Node�system_message)�Inliner)�Sphinx)�RemovedInSphinx60Warning)�__)�SphinxPostTransform)�logging)�split_explicit_title)�RoleFunctionc@s6eZdZdZdZedd�dd�Zejdd�dd	�Z	dS)
�ExternalLinksCheckerz�
    For each external link, check if it can be replaced by an extlink.

    We treat each ``reference`` node without ``internal`` attribute as an external link.
    i�N)�kwargs�returncKs"|j�tj�D]}|�|�qdS�N)Zdocument�findallr�	reference�	check_uri)�selfr�refnode�r�7/usr/lib/python3.9/site-packages/sphinx/ext/extlinks.py�run9szExternalLinksChecker.run)rrc
Cs�d|vsd|vrdS|d}|jjj��D]p\}\}}t�|�dd��}|�|�}|r*|���	d�r*t
d�}d|�d	|���	d��d
�}	tj|||	|d�q*dS)z�
        If the URI in ``refnode`` has a replacement in ``extlinks``,
        emit a warning with a replacement suggestion.
        �internal�refuriN�%sz
(?P<value>.+)�valuezHhardcoded link %r could be replaced by an extlink (try using %r instead)�:z:`�`)�location)
�app�config�extlinks�items�re�compile�replace�match�	groupdict�getr
�loggerZwarning)
rrZuri�aliasZbase_uriZ_captionZuri_patternr,�msgZreplacementrrrr=s
zExternalLinksChecker.check_uri)
�__name__�
__module__�__qualname__�__doc__Zdefault_priorityrrrrrrrrrr0sr)�name�base_url�captionrcs�z�dWn2ttfy>t�dt���dd�d�Yn0�dur�z�dWn2ttfy�t�dt���dd�d�Yn0igftttttt	t
ttt
tt
t
fd���fdd	�
}|S)
NZdummyztextlinks: Sphinx-6.0 will require base URL to contain exactly one '%s' and all other '%' need to be escaped as '%%'.�%z%%r z|extlinks: Sphinx-6.0 will require a caption string to contain exactly one '%s' and all other '%' need to be escaped as '%%'.)�typ�rawtext�text�lineno�inliner�options�contentrcsVt�|�}t|�\}}}	�|	}
|s:�dur2|
}n�|	}tj||d|
d�}|ggfS)NF)rr)rZunescaperrr)r:r;r<r=r>r?r@Zhas_explicit_title�title�partZfull_urlZpnode�r7r8rr�rolehs
zmake_link_role.<locals>.role)�	TypeError�
ValueError�warnings�warnrr+�str�intr
rrrrr	)r6r7r8rDrrCr�make_link_roleRs*���

�
rK)r%rcCs2|jj��D] \}\}}|�|t|||��qdSr)r&r'r(Zadd_rolerK)r%r6r7r8rrr�setup_link_rolesxsrLcCs0|�did�|�dt�|�t�tjdd�S)Nr'�envzbuilder-initedT)�versionZparallel_read_safe)Zadd_config_valueZconnectrLZadd_post_transformr�sphinxZ__display_version__)r%rrr�setup}s
rP)'r5r)rG�typingrrrrZdocutilsrrZdocutils.nodesrr	Zdocutils.parsers.rst.statesr
rOZsphinx.applicationrZsphinx.deprecationrZ
sphinx.localer
Z!sphinx.transforms.post_transformsrZsphinx.utilrZsphinx.util.nodesrZsphinx.util.typingrZ	getLoggerr2r/rrIrKrLrPrrrr�<module>s&
"&

Youez - 2016 - github.com/yon3zu
LinuXploit