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: //usr/lib/python3/dist-packages/sphinx/cmd/__pycache__/make_mode.cpython-310.pyc
o

�$�a��@s�dZddlZddlZddlZddlmZddlmZddlZddlm	Z	ddl
mZmZm
Z
mZddlmZmZgd�ZGd	d
�d
�Zdeedefd
d�ZdS)a�
    sphinx.cmd.make_mode
    ~~~~~~~~~~~~~~~~~~~~

    sphinx-build -M command-line handling.

    This replaces the old, platform-dependent and once-generated content
    of Makefile / make.bat.

    This is in its own module so that importing it is fast.  It should not
    import the main Sphinx modules (like sphinx.applications, sphinx.builders).

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�List)�
build_main)�blue�bold�color_terminal�nocolor)�cd�rmtree))��htmlzto make standalone HTML files)r�dirhtmlz2to make HTML files named index.html in directories)r�
singlehtmlz to make a single large HTML file)r�picklezto make pickle files)r�jsonzto make JSON files)r�htmlhelpz+to make HTML files and an HTML help project)r�qthelpz'to make HTML files and a qthelp project)r�devhelpz(to make HTML files and a Devhelp project)r�epubzto make an epub)r�latexz9to make LaTeX files, you can set PAPER=a4 or PAPER=letter)�posix�latexpdfz.to make LaTeX and PDF files (default pdflatex))r�
latexpdfjaz8to make LaTeX files and run them through platex/dvipdfmx)r�textzto make text files)r�manzto make manual pages)r�texinfozto make Texinfo files)r�infoz3to make Texinfo files and run them through makeinfo)r�gettextzto make PO message catalogs)r�changesz9to make an overview of all changed/added/deprecated items)r�xmlz!to make Docutils-native XML files)r�	pseudoxmlz0to make pseudoxml-XML files for display purposes)r�	linkcheckz)to check all external links for integrity)r�doctestz>to run all doctests embedded in the documentation (if enabled))r�coveragez7to run coverage check of the documentation (if enabled))r�cleanz+to remove everything in the build directoryc@s�eZdZdededeeddfdd�Zdedefd	d
�Zdefdd�Zdd
d�Z	defdd�Z
defdd�Zdefdd�Zdefdd�Z
ddededefdd�ZdS)�Make�srcdir�builddir�opts�returnNcCs&||_||_||_tj�dd�|_dS)N�MAKE�make)r&r'r(�os�environ�get�makecmd)�selfr&r'r(�r1�6/usr/lib/python3/dist-packages/sphinx/cmd/make_mode.py�__init__:sz
Make.__init__�compscGstj|jg|�R�S�N)r�joinr')r0r4r1r1r2�
builddir_join@szMake.builddir_joincCs�t�|j�}t�|j�}t�|j�sdSt�|j�s#td|j�dS||kr0td|j�dSt�||g�|krBtd|j�dStd|j�t�	|j�D]	}t
|�|��qOdS)NrzError: %r is not a directory!�z&Error: %r is same as source directory!z.Error: %r directory contains source directory!zRemoving everything under %r...)r�abspathr&r'�exists�isdir�print�
commonpathr,�listdirr
r7)r0r&r'�itemr1r1r2�build_cleanCs"zMake.build_cleancCspt�st�ttdtj��tdtd�fd�tD]\}}}|r(tj	|kr5tdt|�
d��|f�qdS)Nz
Sphinx v%sz'Please use `make %s' where %s is one of�target�z  %s  %s�
)rrr<r�sphinx�__display_version__r�BUILDERSr,�name�ljust)r0�osname�bname�descriptionr1r1r2�
build_helpVs��zMake.build_helpcC�|�d�dkr	dStjdkrtj�dd�}n|j}z"t|�d���t	�
|dg�Wd�WS1s4wYWdStyKtd|�YdSw�	Nrrr8�win32r*zmake.batzall-pdf�Error: Failed to run: %s�
�run_generic_build�sys�platformr,r-r.r/r	r7�
subprocess�call�OSErrorr<�r0r/r1r1r2�build_latexpdf`�
(��zMake.build_latexpdfcCrMrNrQrXr1r1r2�build_latexpdfjaorZzMake.build_latexpdfjacCs||�d�dkr	dSz#t|�d���t�|jdg�Wd�WS1s%wYWdSty=td|j�YdSw)Nrrr8rrP)rRr	r7rUrVr/rWr<)r0r1r1r2�
build_info~s(��zMake.build_infocCs&|�dd�}|jd|d�dkrdSdS)Nrz	.doctrees)�
doctreedirrr8)r7rR)r0�dtdirr1r1r2�
build_gettext�szMake.build_gettext�builderr]cCsft�dd�}|j}|dvr|�dd|dg�|dur!|�d�}d|d	||j|�|�g}t||�S)
N�PAPERr)�a4�letterz-Dzlatex_elements.papersize=�paper�doctreesz-bz-d)r,�getenvr(�extendr7r&r)r0r`r]�	papersizer(�argsr1r1r2rR�s
�zMake.run_generic_build)r)Nr5)�__name__�
__module__�__qualname__�strrr3r7�intr@rLrYr[r\r_rRr1r1r1r2r%9s


r%rir)cCsjt|�dkrtdtjd�dSt|d|d|dd��}d|d}t||�r.t||��S|�|d�S)N�zJError: at least 3 arguments (builder, source dir, build dir) are required.)�filer8rB�build_r)�lenr<rS�stderrr%�hasattr�getattrrR)rir+�
run_methodr1r1r2�
run_make_mode�s�
rw)�__doc__r,rUrSr�typingrrD�sphinx.cmd.buildr�sphinx.util.consolerrrr�sphinx.util.osutilr	r
rFr%rmrnrwr1r1r1r2�<module>se