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__/intersphinx.cpython-39.opt-1.pyc
a

�abUj�
@s�dZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZmZmZmZmZmZddlmZmZddlmZddlmZmZmZmZdd	lmZm Z ddl!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'dd
l(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1m2Z2ddl3m4Z4ddl5m6Z6m7Z7ddl8m9Z9m:Z:ddl;m<Z<ddl=m>Z>m?Z?m@Z@e6�AeB�ZCGdd�d�ZDeEeEd�dd�ZFdYeEe)e
d�dd�ZGeEeEd�dd �ZHe%eEeed!�d"d#�ZIeEeEeeeeJeKd$�d%d&�ZLe%dd'�d(d)�ZMe+eeEe?e#eed*�d+d,�ZNeeEe>e+eeEeEe#eeed-�d.d/�ZOe-eeEe>eKe+eeEe#eeed0�	d1d2�ZPe-eeEe>eKe#eeed3�d4d5�ZQe-eEeKd6�d7d8�ZRe-eEe#eeed9�d:d;�ZSe-eKe#eeed<�d=d>�ZTe-e#eeed?�d@dA�ZUe%e-e#eeedB�dCdD�ZVGdEdF�dFe9�ZWGdGdH�dHe:�ZXGdIdJ�dJe4�ZYe%eEeeEddK�dLdM�ZZe%e)ddN�dOdP�Z[e%eeEefd'�dQdR�Z\eeEddS�dTdU�Z]eBdVk�r�ddl6Z^e^�_�e]ej`dWd�dX�dS)Za�
    sphinx.ext.intersphinx
    ~~~~~~~~~~~~~~~~~~~~~~

    Insert links to objects documented in remote Sphinx documentation.

    This works as follows:

    * Each Sphinx HTML build creates a file named "objects.inv" that contains a
      mapping from object names to URIs relative to the HTML set's root.

    * Projects using the Intersphinx extension can specify links to such mapping
      files in the `intersphinx_mapping` config value.  The mapping will then be
      used to resolve otherwise missing references to objects into links to the
      other documentation.

    * By default, the mapping file is assumed to be at the same location as the
      rest of the documentation; however, the location of the mapping file can
      also be specified individually, e.g. if the docs should be buildable
      without Internet access.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�
ModuleType)�IO�Any�Dict�List�Optional�Tuple�cast)�urlsplit�
urlunsplit)�nodes)�Element�Node�TextElement�system_message)�Reporter�
relative_path)�pending_xref)�Sphinx)�INVENTORY_FILENAME)�Config)�Domain)�BuildEnvironment)�ExtensionError)�_�__)�ReferencesResolver)�logging�requests)�CustomReSTDispatcher�
SphinxRole)�
InventoryFile)�	Inventory�
InventoryItem�RoleFunctionc@s~eZdZdZedd�dd�Zeeee	ee
effd�dd��Zeed�d	d
��Z
eeeefd�dd��Zdd�d
d�ZdS)�InventoryAdapterz!Inventory adapter for environmentN)�env�returncCs,||_t|d�s(i|j_i|j_i|j_dS)N�intersphinx_cache)r'�hasattrr)�intersphinx_inventory�intersphinx_named_inventory)�selfr'�r.�:/usr/lib/python3.9/site-packages/sphinx/ext/intersphinx.py�__init__>s

zInventoryAdapter.__init__�r(cCs|jjS�N)r'r)�r-r.r.r/�cacheFszInventoryAdapter.cachecCs|jjSr2)r'r+r3r.r.r/�main_inventoryJszInventoryAdapter.main_inventorycCs|jjSr2)r'r,r3r.r.r/�named_inventoryNsz InventoryAdapter.named_inventorycCs|jj��|jj��dSr2)r'r+�clearr,r3r.r.r/r7RszInventoryAdapter.clear)�__name__�
__module__�__qualname__�__doc__rr0�propertyr�strr	�intr#r4r5r6r7r.r.r.r/r&;s"r&)�urlr(cCs6tt|��}d|dvr.|d�d�d|d<t|�S)a�Returns *url* with basic auth credentials removed. Also returns the
    basic auth username and password if they're present in *url*.

    E.g.: https://user:pass@example.com => https://example.com

    *url* need not include basic auth credentials.

    :param url: url which may or may not contain basic auth credentials
    :type url: ``str``

    :return: *url* with any basic auth creds removed
    :rtype: ``str``
    �@�)�listr�splitr)r?�fragsr.r.r/�_strip_basic_authWsrE)r?�configr(cCsBtj|d||jd�}|��|j|j_tj|jjdd�|j_|jS)u�Reads data from *url* with an HTTP *GET*.

    This function supports fetching from resources which use basic HTTP auth as
    laid out by RFC1738 § 3.1. See § 5 for grammar definitions for URLs.

    .. seealso:

       https://www.ietf.org/rfc/rfc1738.txt

    :param url: URL of an HTTP resource
    :type url: ``str``

    :return: data read from resource described by *url*
    :rtype: ``file``-like object
    T)�streamrF�timeout)Zdecode_content)	r�get�intersphinx_timeoutZraise_for_statusr?�raw�	functools�partial�read)r?rF�rr.r.r/�_read_from_urlls

rPcCs^t|�}|jdur|St|�}|jr>d�|j|j|j�|d<nd�|j|j�|d<t|�SdS)a5Gets version of *url* with basic auth passwords obscured. This function
    returns results suitable for printing and logging.

    E.g.: https://user:12345@example.com => https://user@example.com

    :param url: a url
    :type url: ``str``

    :return: *url* with password removed
    :rtype: ``str``
    Nz{}@{}:{}rAz{}@{})r�usernamerB�port�format�hostnamer)r?�partsrDr.r.r/�
_get_safe_url�s
rV)�app�uri�invr(c
Cs�d|v}|st|�}z0d|vr.t||jd�}ntt�|j|�d�}Wn:ty~}z"d||jt	|�f|_
�WYd}~n
d}~00z�t|d�r�|j}||kr�t
�td�||�||t�|�t�|�dfvr�t�|�}|�hz"|r�tjntj}t�|||�}Wn4t�y0}	ztd	|	�|	�WYd}	~	n
d}	~	00Wd�n1�sH0YWn>t�y�}z$d
||jjt	|�f|_
�WYd}~nd}~00|SdS)z6Fetch, parse and return an intersphinx inventory file.�://)rF�rbz4intersphinx inventory %r not fetchable due to %s: %sNr?z)intersphinx inventory has moved: %s -> %s�/z,unknown or unsupported inventory version: %rz3intersphinx inventory %r not readable due to %s: %s)rErPrF�openr�join�srcdir�	Exception�	__class__r=�argsr*r?�logger�infor�dirname�	posixpathr"�load�
ValueErrorr8)
rWrXrYZlocaluri�f�errZnewinvr^�invdata�excr.r.r/�fetch_inventory�s>�

H�rm)�namerX�invsr4rW�nowr(cCs�||jjd}g}�z|D�] }|s2t�|t�}d|vsR||vsR||d|krt|�}	t�td�|	�zt	|||�}
Wn<t
y�}z$|�|j�WYd}~qWYd}~n
d}~00|
r|||
f||<W|gkr�nbt
|�t
|�k�rt�td��|D]}tj|��q�n*d�dd�|D��}
t�td	�d|
�d
SqW|gk�rNnbt
|�t
|�k�r�t�td��|D]}tj|��qrn*d�dd�|D��}
t�td	�d|
�dSt
|�t
|�k�r�t�td��|D]}tj|��q�n*d�dd�|D��}
t�td	�d|
�np|gk�r$nbt
|�t
|�k�r\t�td��|D]}tj|��qHn*d�dd�|D��}
t�td	�d|
�0dS)Ni�QrZrAz(loading intersphinx inventory from %s...zXencountered some issues with some of the inventories, but they had working alternatives:�
cSs g|]}|d|dd��qS)rrANr.��.0rir.r.r/�
<listcomp>��z)fetch_inventory_group.<locals>.<listcomp>zAfailed to reach any of the inventories with the following issues:TF)rF�intersphinx_cache_limitrfr^rrVrcrdrrmr`�appendrb�len�warning)rnrXror4rWrpZ
cache_timeZfailuresrYZsafe_inv_urlrkrjZfailZissuesr.r.r/�fetch_inventory_group�s�
 "
���

���
���

��rz)rWr(c
Cs tt���}t|jj�}tj���b}g}|jj	�
�D]*\}\}}|�|�t
||||j||��q4dd�tj�|�D�}Wd�n1s�0Yt|��r|��t|j�
��}	tdd�|	D��}
dd�|	D�}|
|D]>\}}}
|r�|
|j|<|
��D]\}}|j�|i��|�q�q�dS)z3Load all intersphinx mappings into the environment.cSsg|]}|���qSr.)�resultrrr.r.r/rt�ruz!load_mappings.<locals>.<listcomp>Ncss|]}|dr|VqdS)rNr.�rs�vr.r.r/�	<genexpr>ruz load_mappings.<locals>.<genexpr>cSsg|]}|ds|�qS)rr.r|r.r.r/rtru)r>�timer&Zbuilderr'�
concurrent�futuresZThreadPoolExecutorrF�intersphinx_mapping�valuesrwZsubmitrzr4Zas_completed�anyr7rB�sortedr6�itemsr5�
setdefault�update)rWrpZinventoriesZpoolr�rnrXro�updatedZcached_valsZ
named_valsZunnamed_valsZ_xrk�typeZobjectsr.r.r/�
load_mappings�s&�4
	
r�)�domain�inv_name�data�node�contnoder(cCs|\}}}}d|vr4|�d�r4t�t|dd�|�}|rJtd�||f}	ntd�|f}	tjddd||	d�}
|�d	�r�|
�|�n�|d
ks�|jdkr�|dd
kr�|�	�}|dur�|�
|d�r�|
�|�|t|�dd�|t|�dd���n
|
�|�n|
�|�||��|
S)NrZZrefdoc�.z(in %s v%s)z(in %s)�F)ZinternalZrefuri�reftitleZrefexplicit�-�std�reftype�keyword�:rA)
rIrr^rrr
Z	referencerwrnZastext�
startswithrarx)r�r�r�r�r�Zproj�versionrXZdispnamer��newnode�titler.r.r/�_create_element_from_results,
�
��r�)r��	inventoryr��objtypes�targetr�r�r(c
s�|D]�}||vrq|||vr,|||}nJ|dkr|���tt�fdd�||����}	|	r|||	d}qvqnqt|||||�SdS)Nzstd:termcs|���kSr2)�lower)�k�Ztarget_lowerr.r/�<lambda>9ruz8_resolve_reference_in_domain_by_target.<locals>.<lambda>r)r�rB�filter�keysr�)
r�r�r�r�r�r�r�Zobjtyper�Zinsensitive_matchesr.r�r/�&_resolve_reference_in_domain_by_target)s 
�r�)	r'r�r��honor_disabled_refsr�r�r�r�r(c
s��jdkrd|vr|�d��jdkr8d|vr8|�d��fdd�|D�}|rh|jj��fd	d�|D�}t||�||d
||�}|dur�|S��|�}	|	dur�dSt||�||	||�S)Nr�Z	cmdoption�option�pyZ	attribute�methodcsg|]}d��j|��qS)z{}:{})rSrn)rs�t)r�r.r/rtXruz0_resolve_reference_in_domain.<locals>.<listcomp>csg|]}|�vr|�qSr.r.)rs�o)�disabledr.r/rt]ru�	reftarget)rnrwrF�intersphinx_disabled_reftypesr�Zget_full_qualified_name)
r'r�r�r�r�r�r�r��resZfull_qualified_namer.)r�r�r/�_resolve_reference_in_domainIs&



�

�r�)r'r�r�r�r�r�r(c
Cs�|o
|du}|r d|jjvr dS|d}|dkr�|j��D]N\}}|rX|d|jjvrXq:t|j�}	t||||||	||�}
|
dur:|
Sq:dS|�d�}|s�dS|r�|d|jjvr�dS|�|�}|�	|�}	|	s�dSt||||||	||�SdS)N�*r�r�z:*�	refdomain)
rFr�Zdomainsr�rBZobject_typesr�rI�
get_domainZobjtypes_for_role)r'r�r�r�r�r��typ�domain_namer�r�r�r.r.r/�_resolve_referencemsF�
�

�

�r�)r'r�r(cCs|t|�jvSr2)r&r6)r'r�r.r.r/�inventory_exists�sr�)r'r�r�r�r(cCst||t|�j|d||�S)z�Attempt to resolve a missing reference via intersphinx references.

    Resolution is tried in the given inventory with the target as is.

    Requires ``inventory_exists(env, inv_name)``.
    F)r�r&r6)r'r�r�r�r.r.r/�resolve_reference_in_inventory�s�r�)r'r�r�r�r(cCst|dt|�j|||�S)z�Attempt to resolve a missing reference via intersphinx references.

    Resolution is tried with the target as is in any inventory.
    N)r�r&r5)r'r�r�r�r.r.r/�resolve_reference_any_inventory�s�r�)r'r�r�r(cCsnt|d||�}|dur|S|d}d|vr.dS|�dd�\}}t||�sLdS||d<t||||�}||d<|S)agAttempt to resolve a missing reference via intersphinx references.

    Resolution is tried first with the target as is in any inventory.
    If this does not succeed, then the target is split by the first ``:``,
    to form ``inv_name:newtarget``. If ``inv_name`` is a named inventory, then resolution
    is tried in that inventory with the new target.
    TNr�r�rA)r�rCr�r�)r'r�r�r�r�r�Z	newtargetZres_invr.r.r/�"resolve_reference_detect_inventory�s
r�)rWr'r�r�r(cCst|||�S)zBAttempt to resolve a missing reference via intersphinx references.)r�)rWr'r�r�r.r.r/�missing_reference�sr�cs:eZdZdZeeeeee	e
efd��fdd�Z�Z
S)�IntersphinxDispatcherzyCustom dispatcher for external role.

    This enables :external:***:/:external+***: roles on parsing reST document.
    )�	role_name�language_module�lineno�reporterr(cs8t|�dkr"|�d�r"t|�gfSt��||||�SdS)N�	)z	external:z	external+)rxr��IntersphinxRole�super�role)r-r�r�r�r��rar.r/r��szIntersphinxDispatcher.role)r8r9r:r;r=rr>rr	r%rrr��
__classcell__r.r.r�r/r��s�r�c@s�eZdZe�d�Zedd�dd�Zee	e
e	efd�dd�Zeee
eefd	�d
d�Zee
eeefd	�dd
�Zeeed�dd�Zeeefee	e
e	efd�dd�ZdS)r�z(\+([^:]+))?:(.*)N)�	orig_namer(cCs
||_dSr2)r�)r-r�r.r.r/r0�szIntersphinxRole.__init__r1cCs�|�|j�\}}|rFt|j|�sFtjtd�||jj|jfd�ggfS|�	|�}|dur~tjtd�||jj|jfd�ggfS|�
|�\}}|D]}t|t�r�d|d<||d<q�||fS)Nz4inventory for external cross-reference not found: %s)�locationz/role for external cross-reference not found: %sT�intersphinxr�)
�get_inventory_and_name_suffixr�r�r'rcryr�docnamer��
get_role_name�invoke_role�
isinstancer)r-r�Zname_suffixr�r{�messagesr�r.r.r/�run�s$
�
�

zIntersphinxRole.run)rnr(cCs"tj�|d��dd�\}}||fS)N���)r��_re_inv_ref�	fullmatch�group)r-rnrY�suffixr.r.r/r�s	z-IntersphinxRole.get_inventory_and_name_suffixcCs�|�d�}t|�dkr<|jj�d�}|r.|jnd}|d}n"t|�dkrZ|d}|d}ndS|rv|�||�rv||fS|�d|�r�d|fSdSdS)Nr�rA�default_domainrr�r�)rCrxr'Z	temp_datarIrn�is_existent_role)r-rn�namesr�r�r�r.r.r/r�s


zIntersphinxRole.get_role_name)r�r�r(cCs@z&|j�|�}||jvrWdSWdSWnty:YdS0dS)NTF)r'r�Zrolesr)r-r�r�r�r.r.r/r�(s

z IntersphinxRole.is_existent_role)r�r(cCsT|j�|d�}|rH|�|d�}|d�|�|j|j|j|j|j|j	�SggfSdS)NrrAr�)
r'r�r�r^Zrawtext�textr�Zinliner�optionsZcontent)r-r�r�Z	role_funcr.r.r/r�2s�zIntersphinxRole.invoke_role)r8r9r:�re�compiler�r=r0r	rrrr�rr�r��boolr�r�r.r.r.r/r��s

r�c@s*eZdZdZejdZedd�dd�ZdS)�IntersphinxRoleResolverz�pending_xref node resolver for intersphinx role.

    This resolves pending_xref nodes generated by :intersphinx:***: role.
    rAN)�kwargsr(cKs�|j�t�D]�}d|vrqttj|d���}|d}|durPt|j|||�}nt	|jd||�}|dur�|d}t
d�|d||df}tj||d	|d
�|�
|�q|�
|�qdS)Nr�rr�Fr�z-external %s:%s reference target not found: %sr�r��ref)r�r�Zsubtype)ZdocumentZtraverserr
r
rZdeepcopyr�r'r�rrcryZreplace_self)r-r�r�r�r�r�r��msgr.r.r/r�Es �zIntersphinxRoleResolver.run)r8r9r:r;rZdefault_priorityrr�r.r.r.r/r�=s
r�)rWr��sourcer(cCst�}|��dS)z�Enable IntersphinxDispatcher.

    .. note:: The installed dispatcher will uninstalled on disabling sphinx_domain
              automatically.
    N)r�Zenable)rWr�r��
dispatcherr.r.r/�install_dispatcherZsr�)rWrFr(cCs�|j����D]�\}}z�t|ttf�r`||}\}}t|t�spt�t	d�|�|j�
|�Wqnd||}}}t|t�s�|||fff|j|<n|||ff|j|<Wqty�}z*t�t	d�||�|j�
|�WYd}~qd}~00qdS)Nz0intersphinx identifier %r is not string. Ignoredz3Failed to read intersphinx_mapping[%s], ignored: %r)r��copyr�r�rB�tupler=rcryr�popr`)rWrF�key�valuernrXrYrlr.r.r/�normalize_intersphinx_mappingds"

�
r�cCs�|�did�|�ddd�|�ddd�|�dgd�|jdtd	d
�|�dt�|�dt�|�d
t�|�t�tj	ddd�S)Nr�Trv�FrJr�z
config-initedi )�priorityzbuilder-initedzsource-readzmissing-referencerA)r�Zenv_versionZparallel_read_safe)
Zadd_config_valueZconnectr�r�r�r�Zadd_post_transformr��sphinxZ__display_version__)rWr.r.r/�setup|s
�r�)�argvr(c
s8t|�dkr$tdtjd�t�d�Gdd�d��G�fdd�d�}z||d}t|�d	|�}t|pdi�D]T}t|�t||���D]6\}}td
||ddkr�d
|dnd	|df�q�qhWnrt�y}z(t|j	d|j	dd��WYd}~n:d}~0t
�y2}ztd|�WYd}~n
d}~00dS)z-Debug functionality to print out an inventoryrAzXPrint out an inventory file.
Error: must specify local path or URL to an inventory file.��filec@s"eZdZUdZeed<dZdZdS)z inspect_main.<locals>.MockConfigNrJF)r8r9r:rJr>�__annotations__Z
tls_verifyZ
user_agentr.r.r.r/�
MockConfig�s
r�cs&eZdZdZ��Zedd�dd�ZdS)zinspect_main.<locals>.MockAppr�N)r�r(cSst|tjd�dS)Nr�)�print�sys�stderr)r-r�r.r.r/�warn�sz"inspect_main.<locals>.MockApp.warn)r8r9r:r_rFr=r�r.�r�r.r/�MockApp�sr�rr�z	%-40s %s%sr�r�z%-40s: r�NzUnknown error: %r)rxr�r�r��exitrmr�r�rhrbr`)r�r��filenamerkr��entryZeinforlr.r�r/�inspect_main�s*�
�0r�__main__rA)r�)N)ar;�concurrent.futuresr�rLrfr�r�r�osr�typesr�typingrrrrrr	r
�urllib.parserrZdocutilsr
Zdocutils.nodesrrrrZdocutils.utilsrrr�Zsphinx.addnodesrZsphinx.applicationrZsphinx.builders.htmlrZ
sphinx.configrZsphinx.domainsrZsphinx.environmentrZ
sphinx.errorsrZ
sphinx.localerrZ!sphinx.transforms.post_transformsrZsphinx.utilrrZsphinx.util.docutilsr r!Zsphinx.util.inventoryr"Zsphinx.util.typingr#r$r%Z	getLoggerr8rcr&r=rErPrVrm�floatr�rzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rZ_loggingZbasicConfigr�r.r.r.r/�<module>s�$
(�%!�
� �$

�)��
��U
#


Youez - 2016 - github.com/yon3zu
LinuXploit