HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/sphinx/cmd/__pycache__/build.cpython-310.pyc
o

�$�a�0�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlZddlmZmZddlmZddlmZddlmZdd	lmZmZmZdd
lmZmZmZm Z ddl!m"Z"m#Z#ej$fded
ede%de
ddf
dd�Z&de'de(fdd�Z)dej*fdd�Z+ej,dd�fdee'de(fdd�Z-ej,dd�fdee'de(fdd�Z.ej,dd�fdee'de(fdd�Z/e0d kr�e�1e/ej,dd���dSdS)!z�
    sphinx.cmd.build
    ~~~~~~~~~~~~~~~~

    Build documentation from a provided source.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�IO�Any�List)�
SystemMessage)�__display_version__�package_dir)�Sphinx)�SphinxError)�__)�Tee�format_exception_cut_frames�save_traceback)�color_terminal�nocolor�red�
terminal_safe)�docutils_namespace�patch_docutils�app�args�	exception�stderr�returncCs&t|tj�rdS|jr$tttd��|d�t��t�	t
��d�dSt|d�|js/|jr:t�d|�t|d�t|t
�rIttd�|d�dSt|t�retttd��|d�tt|jd�|d�dSt|t�rttd|j�|d�tt|�|d�dSt|t�r�tttd��|d�ttt|��|d�t|�}tttd	�|�|d�dSt|t�r�d
t|�vr�tttd��|d�ttt|��|d�t|d�ttd�|d�td
|d�dStttd��|d�tt���|d�t|�}tttd	�|�|d�ttd�|d�ttd�|d�dS)Nz5Exception occurred while building, starting debugger:)�file�zInterrupted!zreST markup error:rz%s:zEncoding error:z[The full traceback has been saved in %s, if you want to report the issue to the developers.zrecursion depthzRecursion error:z�This can happen with very large or deeply nested source files. You can carefully increase the default Python recursion limit of 1000 in conf.py with e.g.:z+    import sys; sys.setrecursionlimit(1500)zException occurred:ziPlease also report this if it was a user error, so that a better error message can be provided next time.zbA bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!)�
isinstance�bdb�BdbQuit�pdb�printrr
�	traceback�	print_exc�post_mortem�sys�exc_info�	verbosity�KeyboardInterruptrrrr	�category�str�UnicodeErrorr
�RuntimeErrorr�rstrip)rrrr�tbpath�r-�2/usr/lib/python3/dist-packages/sphinx/cmd/build.py�handle_exception!sf�






�
�
�
���
�r/�valuecCs2|dkrt��St|�}|dkrt�td���|S)z�
    Special type to handle 'auto' flags passed to 'sphinx-build' via -j flag. Can
    be expanded to handle other special scaling requests, such as setting job count
    to cpu_count.
    �autorz&job number should be a positive number)�multiprocessing�	cpu_count�int�argparse�ArgumentTypeErrorr
)r0�jobsr-r-r.�
jobs_argumentUsr8cCsxtjdtd�td�d�}|jddddtd	�|jd
td�d�|jd
td�d�|jddtd�d�|�td��}|jddddtd�d�|jdddtd�d�|jddd td!�d�|jd"d#d$td%�d&�|jd'd(d)td*td+�d,�|�d-�}|jd.d#d/td0�d&�|jd1dd2td3�d�|jd4d5d6d7gtd8�d9�|jd:d;d6d<gtd=�d9�|jd>d?d6d@gtdA�d9�|jdBddCtdD�d�|�tdE��}|jdFdGdHdItdJ�dK�|jdLddMtdN�d�|jdOddPtdQ�d�|jdRdSdTdUtdV�dW�|jdXdYdZdSd[td\�d]�|jd^d_d`tda�d&�|jdbddctdd�d�|jdeddftdg�d�|jdhdditdj�d�|jdkddltdm�d�|S)nNz5%(prog)s [OPTIONS] SOURCEDIR OUTPUTDIR [FILENAMES...]z:For more information, visit <https://www.sphinx-doc.org/>.a�
Generate documentation from source files.

sphinx-build generates documentation from the files in SOURCEDIR and places it
in OUTPUTDIR. It looks for 'conf.py' in SOURCEDIR for the configuration
settings. The 'sphinx-quickstart' tool may be used to generate template files,
including 'conf.py'

sphinx-build can create documentation in different formats. A format is
selected by specifying the builder name on the command line; it defaults to
HTML. Builders can also perform other tasks related to documentation
processing.

By default, everything that is outdated is built. Output only for selected
files can be built by specifying individual filenames.
)�usage�epilog�descriptionz	--version�version�show_versionz%%(prog)s %s)�action�destr<�	sourcedirz"path to documentation source files)�help�	outputdirzpath to output directory�	filenames�*z?a list of specific files to rebuild. Ignored if -a is specified)�nargsrAzgeneral optionsz-b�BUILDER�builder�htmlzbuilder to use (default: html))�metavarr?�defaultrAz-a�
store_true�	force_allz;write all files (default: only write new and changed files))r>r?rAz-E�freshenvz4don't use a saved environment, always read all filesz-d�PATH�
doctreedirzPpath for the cached environment and doctree files (default: OUTPUTDIR/.doctrees))rIr?rAz-j�N�r7z`build in parallel with N processes where possible (special value "auto" will set N to cpu-count))rIrJ�typer?rAzbuild configuration optionsz-c�confdirzOpath where configuration file (conf.py) is located (default: same as SOURCEDIR)z-C�noconfigz*use no config file at all, only -D optionsz-Dz
setting=value�append�definez(override a setting in configuration file)rIr>r?rJrAz-Az
name=value�
htmldefinez pass a value into HTML templatesz-t�TAG�tagsz*define tag: include "only" blocks with TAGz-n�nitpickyz1nit-picky mode, warn about all missing referenceszconsole output optionsz-v�countr%rz$increase verbosity (can be repeated))r>r?rJrAz-q�quietz,no output on stdout, just warnings on stderrz-Q�really_quietz#no output at all, not even warningsz--color�store_const�yesr1z-do emit colored output (default: auto-detect))r>�constrJrAz-Nz
--no-color�color�noz1do not emit colored output (default: auto-detect))r?r>r`rAz-w�FILE�warnfilez)write warnings (and errors) to given filez-W�warningiserrorzturn warnings into errorsz--keep-going�
keep_goingz)with -W, keep going when getting warningsz-Tr z show full traceback on exceptionz-Przrun Pdb on exception)r5�ArgumentParserr
�add_argumentr�add_argument_groupr8)�parser�groupr-r-r.�
get_parseres��
����
�
�
�
��

�
�
�
�
�
��
�
�
��
�
�
�
�
�rlrQ�argvcCsddlm}|�|dd��S)zSphinx build "make mode" entry.r)�	make_moderQN)�
sphinx.cmdrn�
run_make_mode)rmrnr-r-r.�	make_main�srqcCst�}|�|�}|jrd|_n|js|j|_|js"tj�|j	d�|_|j
}g}|D]
}tj�|�s6|�|�q)|rB|�
td�|�|jrN|rN|�
td��|jdks[|jdkr^t�s^t�tj}tj}tj}|jrld}|jrsd}}|r�|jr�zt|jd�}	Wnty�}
z|�
td�|j|
f�WYd}
~
nd}
~
wwt||	�}|}i}|jD]!}z
|�d	d
�\}
}Wnty�|�
td��Ynw|||
<q�|jD]2}z	|�d	�\}
}Wnty�|�
td��Ynwzt |�}Wn	ty�Ynw||d
|
<q�|j!�rd|d<d}zc|j�p|j}t"|��Lt#��6t$|j|j|j	|j|j%||||j&|j'|j(|j)|j*|j+�}|�,|j|�|j-Wd�Wd�WS1�sWwYWd�WdS1�siwYWdStt.f�y�}
zt/|||
|�WYd}
~
dSd}
~
ww)z'Sphinx build "main" command-line entry.Nz	.doctreeszcannot find files %rz&cannot combine -a option and filenamesrbr1�wzcannot open warning file %r: %s�=rQz1-D option argument must be in the form name=valuez1-A option argument must be in the form name=valuezhtml_context.%sTrZr)0rl�
parse_argsrTrSr@rO�os�path�joinrBrC�isfilerU�errorr
rLrarrr#�stdoutrr\r]rd�open�	ExceptionrrV�split�
ValueErrorrWr4rZrrrrGrMrerYr%r7rf�build�
statuscoder&r/)rmrjrrC�
missing_files�filename�status�warningry�warnfp�exc�
confoverrides�val�keyrrSr-r-r.�
build_main�s�

�


���

�

��
�\���r�cCsJtj�tjd�tj�tj�td�d�|dd�dgkr!t	|�St
|�S)N��locale�sphinxrQz-M)r�r��	setlocale�LC_ALL�init_consolerurvrwrrqr�)rmr-r-r.�mains
r��__main__)2�__doc__r5rr�r2rurr#r �typingrrr�docutils.utilsr�
sphinx.localer�rr�sphinx.applicationr�
sphinx.errorsr	r
�sphinx.utilrrr
�sphinx.util.consolerrrr�sphinx.util.docutilsrrr�
BaseExceptionr/r(r4r8rgrlrmrqr�r��__name__�exitr-r-r-r.�<module>s8
$4$_$$U
�