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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�abkc�@s�dZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZddlmZddlmZmZmZdd	lmZdd
lmZddlm Z ddl!m"Z"dd
l#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2m3Z3m4Z4ddl5m6Z6m7Z7m8Z8m9Z9ddl:m;Z;m<Z<m=Z=m>Z>ddl?m@Z@ddlAmBZBddlAmCZCzddlDZDWneE�y�dZDYn0e�r�ddlFmGZGe'�HeI�ZJGdd�d�ZKdS)z�
    sphinx.builders
    ~~~~~~~~~~~~~~~

    Builder superclass for all builders.

    :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�
TYPE_CHECKING�Any�Dict�Iterable�List�Optional�Sequence�Set�Tuple�Type�Union)�nodes)�Node)�Config)�CONFIG_CHANGED_REASON�	CONFIG_OK�BuildEnvironment)�ImageAdapter)�SphinxError)�EventManager)�read_doc)�__)�
import_object�logging�progress_message�rst�status_iterator)�
BuildPhase)�bold)�sphinx_domains)�CatalogInfo�CatalogRepository�docname_to_domain)�SEP�	ensuredir�relative_uri�relpath)�
ParallelTasks�SerialTasks�make_chunks�parallel_available)�Tags)�
directives)�roles)�Sphinxc@s�eZdZUdZdZdZdZdZee	j
ed<dZdZ
dZdZgZeeed<dZdZd	dd
�dd�Zedd
�dd�Zeee	j
d�dd�Zee	j
d�dd�Zdd�dd�Zdd�dd�Zd^eeed�dd�Zd_eeeed�dd�Zeee efd�d d!�Z!eed�d"d#�Z"e#dd$�d%d&�Z$e%e&edd'�d(d)�Z'dd�d*d+�Z(eedd,�d-d.�Z)dd�d/d0�Z*dd�d1d2�Z+eedd3�d4d5�Z,dd�d6d7�Z-d`e eeedd9�d:d;�Z.eed�d<d=�Z/eedd>�d?d@�Z0eee1ddA�dBdC�Z2eddD�dEdF�Z3ee	j4ddG�dHdI�Z5dae ee6eeddJ�dKdL�Z7e6edd>�dMdN�Z8e6ee1ddA�dOdP�Z9e%edd>�dQdR�Z:ee	j4ddG�dSdT�Z;ee	j4ddG�dUdV�Z<dd�dWdX�Z=dd�dYdZ�Z>eeed[�d\d]�Z?dS)b�Builderz6
    Builds target formats from the reST sources.
    �N�default_translator_classZnoneFT�supported_image_typesr/)�app�returncCs�|j|_|j|_|j|_|j|_t|j�||_d|_|j|_|j|_|j	|_	|j	�
|j�|j	�
|j�|j	�
d|j�|j	�
d|j�i|_
d|_d|_d|_d|_dS)Nz	format_%sz
builder_%sr1F)�srcdir�confdirZoutdir�
doctreedirr%r4�env�events�config�tags�add�format�name�imagesZimagedirZimgpath�parallel_ok�finish_tasks)�selfr4�rD�</usr/lib/python3.9/site-packages/sphinx/builders/__init__.py�__init__Ts&
zBuilder.__init__)r9r5cCs||_|j�|j|j�dS)zStore BuildEnvironment object.N)r9Zset_versioning_method�versioning_method�versioning_compare)rCr9rDrDrE�set_environmentps
�zBuilder.set_environment)�argsr5cGs|jj�|�S)zReturn a class of translator.)r4�registry�get_translator_class�rCrJrDrDrErLvszBuilder.get_translator_classcGs|jjj|g|�R�S)z�Return an instance of translator.

        This method returns an instance of ``default_translator_class`` by default.
        Users can replace the translator class with ``app.set_translator()`` API.
        )r4rK�create_translatorrMrDrDrErNzszBuilder.create_translator)r5cCsdS)zoLoad necessary templates and perform initialization.  The default
        implementation does nothing.
        NrD�rCrDrDrE�init�szBuilder.initcCs4|jjrt|jjd��|_nddlm}|�|_dS)z&Return the template bridge configured.ztemplate_bridge settingr)�BuiltinTemplateLoaderN)r;Ztemplate_bridgerZ	templatesZsphinx.jinja2gluerQ)rCrQrDrDrE�create_template_bridge�s�
zBuilder.create_template_bridge)�docname�typr5cCst�dS)z�Return the target URI for a document name.

        *typ* can be used to qualify the link characteristic for individual
        builders.
        N��NotImplementedError)rCrSrTrDrDrE�get_target_uri�szBuilder.get_target_uri)�from_�torTr5cCst|�|�|�||��S)z�Return a relative URI between two source filenames.

        May raise environment.NoUri if there's no way to return a sensible URI.
        )r&rW)rCrXrYrTrDrDrE�get_relative_uri�s

�zBuilder.get_relative_uricCst�dS)aDReturn an iterable of output files that are outdated, or a string
        describing what an update build will build.

        If the builder does not output individual files corresponding to
        source files, return a string here.  If it does, return an iterable
        of those files that need to be written.
        NrUrOrDrDrE�get_outdated_docs�szBuilder.get_outdated_docscCsgS)z;Return list of paths for assets (ex. templates, CSS, etc.).rDrOrDrDrE�get_asset_paths�szBuilder.get_asset_paths)�doctreer5cCs�t|j�}|�tj�D]�}d|dvr(qd|dvr�|jD]}|d�|d�}|r:q�q:t|d�}|�|d�}|r�t	j
td�|j|||d�qt	j
td�|j||d�q||d<n|d}||jj
vr�q|jj
|d	|j
|<qdS)
z+Pick the best candidate for all image URIs.�?Z
candidates�*NZuriz2a suitable image for %s builder not found: %s (%s))�locationz-a suitable image for %s builder not found: %s�)rr9�findallrZimager3�get�sortedZget_original_image_uri�logger�warningrr?r@)rCr]r@ZnodeZimgtype�	candidateZ	mimetypesZ	image_urirDrDrE�post_process_images�s0



�
�
zBuilder.post_process_images)�catalogs�messager5cst�jjsdSttd��fdd�}t�ttd��|�t|td�dt	|��j
j|d�D]}|��jj
�jj�qVdS)N)�catr5cst|j�jj��tjt�S�N)r'Zmo_pathr9r6�replacer�sepr$)rkrOrDrE�cat2relpath�sz-Builder.compile_catalogs.<locals>.cat2relpathzbuilding [mo]: �writing output... �	darkgreen)Zstringify_func)r;Zgettext_auto_buildr!�strre�inforrr�lenr4�	verbosityZwrite_mo�languageZ gettext_allow_fuzzy_translations)rCrirjro�catalogrDrOrE�compile_catalogs�s�

�zBuilder.compile_catalogscCsHt|j|jj|jj|jj�}td�tt|j	��}|�
t|j	�|�dS)Nzall of %d po files)r"r6r;�locale_dirsrv�source_encodingrrt�listrirx�set)rC�reporjrDrDrE�compile_all_catalogs�s
�zBuilder.compile_all_catalogs)�specified_filesr5cs�tttd��fdd�}t�}tt||��}t�j�jj�jj�jj	�}|j
D] }|j|vrN|��rN|�
|�qNtd�t|�}��||�dS)N)�fpathr5cs,�j�t�|��}|r$t|�jj�SdSdSrl)r9Zpath2docr�abspathr#r;Zgettext_compact)r�rSrOrDrE�	to_domain�sz4Builder.compile_specific_catalogs.<locals>.to_domainz*targets for %d po files that are specified)rrrr|�mapr"r6r;ryrvrzri�domain�is_outdatedr=rrtrx)rCrr�riZdomainsr}rwrjrDrOrE�compile_specific_catalogs�s�
z!Builder.compile_specific_catalogscCsLt|j|jj|jj|jj�}dd�|jD�}td�t|�}|�	||�dS)NcSsh|]}|��r|�qSrD)r�)�.0�crDrDrE�	<setcomp>��z2Builder.compile_update_catalogs.<locals>.<setcomp>z,targets for %d po files that are out of date)
r"r6r;ryrvrzrirrtrx)rCr}rirjrDrDrE�compile_update_catalogs�s�zBuilder.compile_update_catalogscCs|jdtd�dd�dS)zBuild all source files.Nzall source files�all)�summary�method)�buildrrOrDrDrE�	build_allszBuilder.build_all)�	filenamesr5cCs�t|j�d}g}t|jj�}|D]�}t�t�|��}|�|j�sTt	�
td�|�q"t�|�spt	�
td�|�q"||d�}|D]$}|�
|�r�|dt|��}q�q�|�tjt�}|�|�q"|j|dtd�t|�d�dS)z>Only rebuild as much as needed for changes in the *filenames*.razIfile %r given on command line is not under the source directory, ignoringz6file %r given on command line does not exist, ignoringNZspecificz%%d source files given on command line)r�r�)rtr6�tupler;Z
source_suffixr�normpathr��
startswithrerfr�isfile�endswithrmrnr$�appendr�)rCr�ZdirlenZto_write�suffixes�filename�suffixrDrDrE�build_specifics2
�

�
�zBuilder.build_specificcCsH|��}t|t�r"|�dg|�n"t|�}|j|td�t|�d�dS)z8Only rebuild what was changed or added since last build.�__all__z0targets for %d source files that are out of date)r�N)r[�
isinstancerrr�r{rrt)rCZto_buildrDrDrE�build_updates
��zBuilder.build_update�update)�docnamesr�r�r5c
	CsB|r t�ttd�|j�|�t���t|���}Wd�n1sJ0Yt	|�}tjttd��dd�|j
�|j|�D]}|�
|�q�t	|�|}|r�t�td�|�nt�td��|�r�dd	lm}ttd
���Xtt�|j|�d��"}	t�|j
|	tj�Wd�n1�s 0YWd�n1�s@0Ytj|j_ttd���|j
��Wd�n1�s�0Yn&|d
k�r�|�s�t�ttd���dStj|j_|�r�|dgk�r�t|�|j
j@}t�r|jjdk�r|j �r|j�!d�|_"nd|_"t#�|_$|�%|t&|�|�|�'�|j$��dS)zaMain build method.

        First updates the environment, and then calls :meth:`write`.
        zbuilding [%s]: Nz"looking for now-outdated files... T�Znonlz%d foundz
none foundr)�ENV_PICKLE_FILENAMEzpickling environment�wbzchecking consistencyr�zno targets are out of date.r�ra�writeF)(rersrrr?r�pending_warningsr|�readrtr9Zcheck_dependentsr4r=�sphinx.applicationr�r�openr�joinr8�pickle�dump�HIGHEST_PROTOCOLrZCONSISTENCY_CHECK�phaseZcheck_consistency�	RESOLVING�
found_docsr+�parallel�allow_parallel�is_parallel_allowedrAr)rBr�r{�finish)
rCr�r�r��updated_docnamesZdoccountrSZoutdatedr��frDrDrEr�*sB
*R
,
z
Builder.buildcCs�tjttd��dd�|j�|j|�|jjtk}|j�	|�\}}}|j
�d|j|||�D]}|�t
|�|jj@�qZ|s~|r�|�|jj|jj@�|r�t�|jjd�|jjp�d}tjd|dd�t�td�t|�t|�t|��|D]"}|j
�d|j|�|j�|�q�t||B�}|j
�d	|j|�t�rZt|�d
k�rZ|jjdk�rZ|j�d�}	nd
}	|	�rx|j||jjd�n
|�|�|jj|jjv�r�td|j�|jj���|j
�d|j�D]}
|
du�r�|� |
��q�t|j_t|�S)z�(Re-)read all files new or changed since last update.

        Store all environment docnames in the canonical format (ie using SEP as
        a separator in place of os.path.sep).
        zupdating environment: Tr�zenv-get-outdatedr1z[%s] z %s added, %s changed, %s removed�
env-purge-doczenv-before-read-docs�rar�F��nproczroot file %s not foundzenv-updatedN)!rersrrr9Z
find_filesr;Z
config_statusrZget_outdated_filesr:�emitr�r|r�Z
glob_toctreesrrcZconfig_status_extrart�	clear_docrdr+r4r�r��_read_parallel�_read_serial�root_doc�all_docsr�doc2path�extend)rC�updatedZaddedZchangedZremoved�docs�reasonrSr�Zpar_okZretvalrDrDrEr�nsH
�
�"
�
zBuilder.read)r�r5cCsNt|td�dt|�|jj�D],}|j�d|j|�|j�|�|�	|�qdS)N�reading sources... �purpler�)
rrrtr4rur:r�r9r�r)rCr�rSrDrDrEr��s�zBuilder._read_serial)r�r�r5c	s�|D]"}�j�d�j|��j�|�qtttd��fdd�}tttdd��fdd�}t|�}t||�}t	|t
d�d	t|��jj
�D]}|�|||�q�t�tt
d
���|��dS)Nr��r�r5cs.�j�j_|D]}��|�qt��jtj�Srl)r4r9rr��dumpsr�)r�rSrOrDrE�read_process�s
z,Builder._read_parallel.<locals>.read_process)r��otherenvr5cs t�|�}�j�||�j�dSrl)r��loadsr9Zmerge_info_fromr4)r�r�r9rOrDrE�merge�s
z%Builder._read_parallel.<locals>.merger�r��waiting for workers...)r:r�r9r�rrr�bytesr(r*rrrtr4ru�add_taskrersrr�)	rCr�r�rSr�r��tasks�chunks�chunkrDrOrEr��s
�zBuilder._read_parallel)rSr5c	Cs�|j�|�t�|jd�}t�|�r0|j�|�t|j��Xt�	||j
j	��(t|j|j|j�
|��}Wd�n1sz0YWd�n1s�0Ytt��t�|j�
|���|jj|<|jj��|jj��|�||�dS)z>Parse a file and add/update inventory entries for the doctree.z
docutils.confN)r9Zprepare_settingsrr�r7r�Znote_dependencyr rZdefault_roler;rr4r��max�time�getmtimer�Z	temp_data�clearZref_context�
write_doctree)rCrSZdocutilsconfr]rDrDrEr�s
T�zBuilder.read_doc)rSr]r5cCs�d|_d|_d|j_d|j_d|j_t�|j|d�}t	t�
|��t|d�� }t�
||tj�Wd�n1st0YdS)zWrite the doctree to a file.Nz.doctreer�)ZreporterZtransformerZsettingsZwarning_streamr9Zrecord_dependenciesrr�r8r%�dirnamer�r�r�r�)rCrSr]Zdoctree_filenamer�rDrDrEr��szBuilder.write_doctree)�build_docnamesr�r�r5cCs
|dus|dgkr|jj}|dkr4t|�t|�B}nt|�}t�td�d�t|���t|�D]2}|jj	�
|t��D]}||jjvrt|�|�qtq^|�|jj
�ttd���|�|�Wd�n1s�0Y|jr�|jt|�|jjdd�n|�t|��dS)Nr�r�zdocnames to write: %sz, zpreparing documentsrar�)r9r�r|re�debugrr�rdr{Zfiles_to_rebuildrcr=r;r�r�prepare_writingrA�_write_parallelr4r��
_write_serial)rCr�r�r�r�rSZ
tocdocnamerDrDrEr��s$(

�z
Builder.writecCs�t���lt|td�dt|�|jj�D]>}tj|j_	|j
�||�}tj|j_	|�
||�|�||�q&Wd�n1sz0YdS)Nrprq)rr�rrrtr4rurr�r�r9�get_and_resolve_doctree�WRITING�write_doc_serialized�	write_doc)rCr�rSr]rDrDrEr�s
�

zBuilder._write_serialcsttttjfdd��fdd�}|d|dd�}}tj�j_�j	�
|��}tj�j_��||���
||�t|�}t||�}tj�j_t|td�dt|��jj�D]F}g}	|D],}
�j	�
|
��}��|
|�|	�|
|f�q�|�||	�q�t�ttd���|��dS)	Nr�cs(tj�j_|D]\}}��||�qdSrl)rr�r4r�r�)r�rSr]rOrDrE�
write_process!s
z.Builder._write_parallel.<locals>.write_processrrarprqr�)rrrrr�documentrr�r4r�r9r�r�r�r�r(r*rrrtrur�r�rersrr�)rCr�r�r�Z	firstnamer]r�r�r��argrSrDrOrEr� s*"



�zBuilder._write_parallelcCst�dS)z?A place where you can add logic before :meth:`write_doc` is runNrU)rCr�rDrDrEr�?szBuilder.prepare_writingcCst�dS)z5Where you actually write something to the filesystem.NrU�rCrSr]rDrDrEr�CszBuilder.write_doccCsdS)zoHandle parts of write_doc that must be called in the main process
        if parallel build is active.
        NrDr�rDrDrEr�GszBuilder.write_doc_serializedcCsdS)zWFinish the building process.

        The default implementation does nothing.
        NrDrOrDrDrEr�MszBuilder.finishcCsdS)zQCleanup any resources.

        The default implementation does nothing.
        NrDrOrDrDrE�cleanupTszBuilder.cleanup)�option�defaultr5cCsLzd|j|f}t|j|�WStyFd||f}t|j|�YS0dS)z�Return a builder specific option.

        This method allows customization of common builder settings by
        inserting the name of the current builder in the option key.
        If the key does not exist, use default as builder name.
        z%s_%sN)r?�getattrr;�AttributeError)rCr�r�ZoptnamerDrDrE�get_builder_config[s	zBuilder.get_builder_config)N)N)Nr�)r�)@�__name__�
__module__�__qualname__�__doc__r?r>�epilogr2rrZNodeVisitor�__annotations__rGrHr�Zuse_message_catalogr3rrrZsupported_remote_imagesZsupported_data_uri_imagesrFrrIrrLrNrPrRrWrZr
rr[r\rrhr
r!rxr~r�r�r�r�r�r�r�r��intr�rr�r�r	r�r�r�r�r�r�r�r�r�rDrDrDrEr03sZ
		
!	D@
r0)Lr�r�r��osr�typingrrrrrrr	r
rrr
ZdocutilsrZdocutils.nodesrZ
sphinx.configrZsphinx.environmentrrrZ!sphinx.environment.adapters.assetrZ
sphinx.errorsrZ
sphinx.eventsrZ	sphinx.iorZ
sphinx.localerZsphinx.utilrrrrrZsphinx.util.build_phaserZsphinx.util.consolerZsphinx.util.docutilsr Zsphinx.util.i18nr!r"r#Zsphinx.util.osutilr$r%r&r'Zsphinx.util.parallelr(r)r*r+Zsphinx.util.tagsr,Zsphinxr-r.Zmultiprocessing�ImportErrorr�r/Z	getLoggerr�rer0rDrDrDrE�<module>s>
4



Youez - 2016 - github.com/yon3zu
LinuXploit