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__/quickstart.cpython-310.pyc
o

�$�a�]�
@sTdZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZzddlZejrEdejvrEe�d�dZne�d	�d
ZWn
eyZdZd
ZYnwddlmZddlZddlmZmZdd
lmZddlmZmZmZmZmZddl m!Z!ddl"m#Z#eded�fded�fded�fded�fded�fded�fded�fded �fd!ed"�fd#ed$�fg
�Z$d%d
d&dd'd(ddd)�Z%d*Z&ej'd+kr�d,Z(nd-Z(d.e)d/e)fd0d1�Z*Gd2d3�d3e+�Z,d4e)d/e)fd5d6�Z-d4e)d/e)fd7d8�Z.d4e)d/e)fd9d:�Z/d4e)d/e)fd;d<�Z0d=e)d/ee)ge)ffd>d?�Z1d4e)d/e2fd@dA�Z3d4e)d/e)fdBdC�Z4d4e)d/e)fdDdE�Z5de0fdFe)dGe)dHee)ge
fd/ee)e2ffdIdJ�Z6GdKdL�dLe#�Z7dMed/dfdNdO�Z8d^dMedPe2dQe2dRe)d/df
dSdT�Z9dMed/e2fdUdV�Z:d/ej;fdWdX�Z<ej=dYd�fdZe
e)d/e>fd[d\�Z?e@d]k�r�e�Ae?ej=dYd���dSdS)_z�
    sphinx.cmd.quickstart
    ~~~~~~~~~~~~~~~~~~~~~

    Quickly setup documentation source to work with Sphinx.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�OrderedDict)�path)�Any�Callable�Dict�List�Union�libeditzbind ^I rl_completeTz
tab: completeF)�column_width)�__display_version__�package_dir)�__)�bold�color_terminal�colorize�nocolor�red)�	ensuredir)�SphinxRenderer�autodocz,automatically insert docstrings from modules�doctestz2automatically test code snippets in doctest blocks�intersphinxz7link between Sphinx documentation of different projects�todoz9write "todo" entries that can be shown or hidden on build�coveragez!checks for documentation coverage�imgmathz+include math, rendered as PNG or SVG images�mathjaxz0include math, rendered in the browser by MathJax�ifconfigz7conditional inclusion of content based on config values�viewcodez=include links to the source code of documented Python objects�githubpagesz=create .nojekyll file to publish the document on GitHub pages�.�_�.rst�index)r�sep�dot�language�suffix�master�makefile�	batchfilez> �win32r�purple�prompt�returncCs&tjdkrt|dd�td�St|�S)Nr*���end)�sys�platform�print�input)r,�r5�7/usr/lib/python3/dist-packages/sphinx/cmd/quickstart.py�
term_inputLs
r7c@seZdZdZdS)�ValidationErrorzRaised for validation errors.N)�__name__�
__module__�__qualname__�__doc__r5r5r5r6r8Wsr8�xcCs$t�|�}t�|�sttd���|S)NzPlease enter a valid path name.)r�
expanduser�isdirr8r
�r=r5r5r6�is_path[s

rAcCs|dkr|St|�S�Nr.)rAr@r5r5r6�is_path_or_emptybsrCcC�|S�Nr5r@r5r5r6�allow_emptyh�rFcCs|sttd���|S)NzPlease enter some text.)r8r
r@r5r5r6�nonemptylsrH�lcsdtdtf�fdd�}|S)Nr=r-cs"|�vrttd�d�����|S)NzPlease enter one of %s.�, )r8r
�joinr@�rIr5r6�valsszchoice.<locals>.val)�str)rIrMr5rLr6�choicersrOcCs$|��dvrttd���|��dvS)N)�Y�YES�N�NOzPlease enter either 'y' or 'n'.)rPrQ)�upperr8r
r@r5r5r6�booleanzsrUcCs,|dd�dkrt|�dksttd���|S)Nr�rz2Please enter a file suffix, e.g. '.rst' or '.txt'.)�lenr8r
r@r5r5r6r&�sr&cCrDrEr5r@r5r5r6�ok�rGrX�text�default�	validatorc
Cs�	|durtd||f}nt|d}trntr!tt|dd�}ntt|dd�}t|���}|r4|s4|}z||�}W	|StyX}ztt	dt
|���WYd}~qd}~ww)NTz	%s [%s]: z: )�
input_modeFz* )�
PROMPT_PREFIX�USE_LIBEDIT�readliner�COLOR_QUESTIONr7�stripr8r3rrN)rYrZr[r,r=�errr5r5r6�	do_prompt�s*
���rccsReZdZdeddf�fdd�Zdedefdd�Zded	edef�fd
d�Z�Z	S)�QuickstartRenderer�templatedirr-Ncs|pd|_t���dSrB)re�super�__init__)�selfre��	__class__r5r6rg�s
zQuickstartRenderer.__init__�
template_namecCs,t�|jt�|��}|jrt�|�rdSdS)z�Check if custom template file exists.

        Note: Please don't use this function from extensions.
              It will be removed in the future without deprecation period.
        TF)rrKre�basename�exists)rhrk�templater5r5r6�_has_custom_template�sz'QuickstartRenderer._has_custom_template�contextcs8|�|�rt�|jt�|��}|�||�St��||�SrE)rorrKrerl�render_from_filerf�render)rhrkrp�custom_templaterir5r6rr�s
zQuickstartRenderer.render)
r9r:r;rNrg�boolrorrr�
__classcell__r5r5rir6rd�s"rd�dc	Csptttd��t�t�ttd��d|vr't�tttd��|d�nt�ttd��ttd�dt�|d<t�t�|dd��sQt�t�|dd	d��r�t�tttd
���ttd��t�ttd�d
t	�|d<|dsxt
�d�t�t�|dd��sQt�t�|dd	d��sQd|vr�t�ttd��ttd�dt�|d<d|vr�t�ttd��ttd�dt
�|d<d|vr�t�ttd��ttd��|d<d|vr�ttd��|d<d|vr�t�ttd��ttd�d
t�|d<d|v�rttd �|dt�|d<d!|v�r(t�ttd"��ttd#�d$�|d!<|d!d$k�r(d%|d!<d&|v�r@t�ttd'��ttd(�d)t�|d&<d*|v�rWt�ttd+��ttd,�d-�|d*<t�t�|d|d*|d&���s|t�t�|dd	|d*|d&���r�t�tttd.�|d*|d&��ttd/��t�ttd0�|d*�|d*<t�t�|d|d*|d&���s|t�t�|dd	|d*|d&���s|d1|v�rttd2��g|d1<t��D]\}}td3||fdt��r�|d1�d4|��q�d5d6h�|d1��rttd7��|d1�d5�d8|v�r$t�ttd9��ttd:�d;t�|d8<d<|v�r3ttd=�d;t�|d<<t�d%S)>a4Ask the user for quickstart values missing from *d*.

    Values are:

    * path:      root path
    * sep:       separate source and build dirs (bool)
    * dot:       replacement for dot in _templates etc.
    * project:   project name
    * author:    author names
    * version:   version of project
    * release:   release of project
    * language:  document language
    * suffix:    source file suffix
    * master:    master document name
    * extensions:  extensions to use (list)
    * makefile:  make Makefile
    * batchfile: make command file
    z,Welcome to the Sphinx %s quickstart utility.zyPlease enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).rzSelected root path: %sz&Enter the root path for documentation.zRoot path for the documentationr�conf.py�sourcezDError: an existing conf.py has been found in the selected root path.z>sphinx-quickstart will not overwrite existing Sphinx projects.z4Please enter a new root path (or just Enter to exit)r.rVr#z�You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.z+Separate source and build directories (y/n)�nr$z�Inside the root directory, two more directories will be created; "_templates"
for custom HTML templates and "_static" for custom stylesheets and other static
files. You can enter another prefix (such as ".") to replace the underscore.z(Name prefix for templates and static dirr �projectzIThe project name will occur in several places in the built documentation.zProject name�authorzAuthor name(s)�versiona-Sphinx has the notion of a "version" and a "release" for the
software. Each version can have multiple releases. For example, for
Python the version is something like 2.5 or 3.0, while the release is
something like 2.5.1 or 3.0a1. If you don't need this dual structure,
just set both to the same value.zProject version�releasezProject releaser%a3If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.

For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.zProject language�enNr&z�The file name suffix for source files. Commonly, this is either ".txt"
or ".rst". Only files with this suffix are considered documents.zSource file suffixr!r'aOne document is special in that it is considered the top node of the
"contents tree", that is, it is the root of the hierarchical structure
of the documents. Normally, this is "index", but if your "index"
document is a custom template, you can also set this to another filename.z-Name of your master document (without suffix)r"zKError: the master file %s has already been found in the selected root path.z7sphinx-quickstart will not overwrite the existing file.zIPlease enter a new file name, or rename the existing file and press Enter�
extensionszDIndicate which of the following Sphinx extensions should be enabled:z%s: %s (y/n)�
sphinx.ext.%szsphinx.ext.imgmathzsphinx.ext.mathjaxzZNote: imgmath and mathjax cannot be enabled at the same time. imgmath has been deselected.r(z�A Makefile and a Windows command file can be generated for you so that you
only have to run e.g. `make html' instead of invoking sphinx-build
directly.zCreate Makefile? (y/n)�yr)z"Create Windows command file? (y/n))r3rr
rrcrAr�isfilerKrCr1�exitrUrXrFr&�
EXTENSIONS�items�append�issubset�remove)rv�name�descriptionr5r5r6�ask_user�s���
��



$"�
��$�"�

�


r��	overwrite�silentrec	s�t|d�}d�vr
d�d<d�vrd�d<�d�d<t���d<t�d	�d
�d<��dg�t�d
�d�d�d<tj��d��d<t	�d��drZt�
�dd�n�d}t	|��drst�
�dd�}d�d<nt�
|�dd�}tt�ddddg�}d�
|��d<t	|�t	t�
|�dd��t	t�
|�dd��d?dt
dt
dt
ddf��fd d!�
}|r�tj�
|d"�nd}	|	r�t�|	�s�tj�
tdd#d"�}	t|	��}
|
��}Wd�n1s�wY|t�
|d$�|�|���t�
|�d�d%�}|�d&��r"d'}
ttd(|
��|||�d&���n	|||�d)�����d*�d+u�r8d,}d-}nd.}d/}�d0d+u�rm�d�rJdnd1�d2<�d�rUdn�dd�d3<|t�
�dd4�|�|��d5��d6d+u�r��d�r{dnd1�d2<�d�r�dn�dd�d3<|t�
�dd7�|�|��d8�|�r�dSt�tttd9���t�ttd:�|dd;��d0�sňd6�r�ttd<��n
ttd=�||f�ttd>��t�dS)@z(Generate project based on values in *d*.)re�
mastertoctreer.�mastertocmaxdepth�r'�root_doc�nowrz�=�project_underlinerz%YrJr{�	copyrightrr#rx�build�exclude_patternsr$z	Thumbs.dbz	.DS_Store�	templates�staticN�fpath�content�newliner-cs��st�|�s3d�vrttd�|�t|dd|d��}|�|�Wd�dS1s,wYdSd�vrAttd�|�dSdS)N�quietzCreating file %s.�wtzutf-8)�encodingr�z!File %s already exists, skipping.)rr�r3r
�open�write)r�r�r��f�rvr�r5r6�
write_filems"��zgenerate.<locals>.write_filez	conf.py_t�
quickstartrwr&zquickstart/master_doc.rst_tz{A custom template `master_doc.rst_t` found. It has been renamed to `root_doc.rst_t`.  Please rename it on your project too.rzquickstart/root_doc.rst_t�	make_modeTzquickstart/Makefile.new_tzquickstart/make.bat.new_tzquickstart/Makefile_tzquickstart/make.bat_tr(r�rsrcdir�	rbuilddir�Makefile�
r)�make.batz
z:Finished: An initial directory structure has been created.zYYou should now populate your master file %s and create other documentation
source files. r/z<Use the Makefile to build the docs, like so:
   make builderzYUse the sphinx-build command to build the docs, like so:
   sphinx-build -b builder %s %szPwhere "builder" is one of the supported builders, e.g. html, latex or linkcheck.rE)rd�time�asctimer
�
setdefault�strftime�osr�abspathrrK�map�reprrNr�rr��read�
render_stringror3rrr�getrr
)rvr�r�rern�srcdir�builddirr�r��	conf_pathr��	conf_text�
masterfile�msg�makefile_template�batchfile_templater5r�r6�generateIs�
 

�"


������
r�cCs�|d}t�|�sdSt�|�sdSddhtt�|��@rdS|dr8tj�d|�}t�|�s1dSt�|�s8dSd|d	d
|d	d|d|d
g}t|�tt�|��@rYdSdS)NrTFr�r�r#rxrwr$r�r�r'r&)rrmr?�setr��listdirrK)rv�dir�reserved_namesr5r5r6�	valid_dir�s*





�r�cCs�td�}tjdtd�|d�}|jdddddtd	�d
�|jddd
dtd�|jddddtd�d�|�td��}|jddddtd�d
�|jdddtd�d�|jddd td!�d"�|�td#��}|jd$d%d&d'td(�d)�|jd*d+d,d-td.�d)�|jd/d0dd1td2�d3�|jd4d5d6d7td8�d)�|jd9d:d;d<td=�d)�|jd>d?d@tdA�d"�|jdBdCdDtdE�d"�|jdFddGtdH�dI�|�tdJ��}tD]}|jdK|dLdM|dNtdO�|dP�q�|jdQdRdNdStdT�dU�|�tdV��}|jdWddXdYtdZ�d
�|jd[ddXtd\�d�|jd]dd^dYtd_�d
�|jd`dd^tda�d�|jdbdcddddYtde�d
�|jdfdgdddtdh�d�|�tdi��}|jdjdkdldmtdn�d)�|jdodpdSdqtdr�ds�|S)tNz�
Generate required files for a Sphinx project.

sphinx-quickstart is an interactive tool that asks some questions about your
project and then generates a complete documentation directory and sample
Makefile to be used with sphinx-build.
z %(prog)s [OPTIONS] <PROJECT_DIR>z:For more information, visit <https://www.sphinx-doc.org/>.)�usage�epilogr�z-qz--quiet�
store_truer�z
quiet mode)�action�destrZ�helpz	--versionr|�show_versionz%%(prog)s %s)r�r�r|r�PROJECT_DIRr�?zproject root)�metavarrZ�nargsr�zStructure optionsz--sepr#z,if specified, separate source and build dirsz--no-sep�store_falsez/if specified, create build dir under source dir)r�r�r�z--dot�DOTr z&replacement for dot in _templates etc.)r�rZr�zProject basic optionsz-pz	--project�PROJECTrzzproject name)r�r�r�z-az--author�AUTHORr{zauthor namesz-v�VERSIONr.zversion of project)r�r�rZr�z-rz	--release�RELEASEr}zrelease of projectz-lz
--language�LANGUAGEr%zdocument languagez--suffix�SUFFIXr!zsource file suffixz--master�MASTERr"zmaster document namez--epubFzuse epub)r�rZr�zExtension optionsz--ext-%s�append_constr�rzenable %s extension)r��constr�r�z--extensionsr�r�zenable arbitrary extensions)r�r�r�r�zMakefile and Batchfile creationz
--makefiler(Tzcreate makefilez
--no-makefilezdo not create makefilez--batchfiler)zcreate batchfilez--no-batchfilezdo not create batchfilez-mz--use-make-moder�z#use make-mode for Makefile/make.batz-Mz--no-use-make-modez*do not use make-mode for Makefile/make.batzProject templatingz-tz
--templatedir�TEMPLATEDIRrez%template directory for template filesz-dz
NAME=VALUE�	variableszdefine a template variable)r�r�r�r�)r
�argparse�ArgumentParser�add_argumentr�add_argument_groupr�)r��parser�group�extr5r5r6�
get_parser�s����
���
�
������
�
�
�
�
��
���
�
�
�
�r�rV�argvc

Cs
tj�tjd�tj�tj�td�d�t	�st
�t�}z|�|�}Wnt
y9}z	|jWYd}~Sd}~wwt|�}dd�|��D�}|�dg�|ddd�D]}d|vrl|d�|�|d�|�d��qUzSd|vr�d	d
h�|�s�ttd��WdShd
��|�r�|�dd�|�d|d�t��}|�|�|}t|�s�t�tttd���ttd��WdSnt|�Wnttfy�t�td�YdSw|� dg�D] }z
|�d�\}}	|	||<Wq�t!y�ttd�|�Yq�wt"|d|j#d�dS)Nr.�locale�sphinxcSsi|]\}}|dur||�qSrEr5)�.0�k�vr5r5r6�
<dictcomp>0szmain.<locals>.<dictcomp>r�,r�rzr{zH"quiet" is specified, but any of "project" or "author" is not specified.rV>r�r{rzr|r}zHError: specified path is not a directory, or sphinx files already exist.zWsphinx-quickstart only generate into a empty directory. Please specify a new root path.z[Interrupted.]�r�r�zInvalid template variable: %sF)r�rer)$r�r��	setlocale�LC_ALL�init_consoler�rrKrrrr��
parse_args�
SystemExit�code�varsr�r�r��extend�splitr�r3r
�DEFAULTS�copy�updater�rr��KeyboardInterrupt�EOFErrorr��
ValueErrorr�re)
r�r��argsrbrvr��d2�variabler��valuer5r5r6�main sh���
����r�__main__)TFN)Br<r�r�r�r1r��collectionsrr�typingrrrrrr_�parse_and_bindr^�ImportError�docutils.utilsr
�
sphinx.localer�rrr
�sphinx.util.consolerrrrr�sphinx.util.osutilr�sphinx.util.templaterr�r�r]r2r`rNr7�	Exceptionr8rArCrFrHrOrtrUr&rXrcrdr�r�r�r�r�r��intrr9r�r5r5r5r6�<module>s�


��









��
2
�e$U
A�