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/builders/__pycache__/texinfo.cpython-310.pyc
o

�$�a�$�@s�dZddlZddlmZddlmZmZmZmZmZm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZmZdd
lmZddlmZddlmZdd
lmZddlmZddlm Z m!Z!ddl"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4e#�5e6�Z7ej�8edd�Z9Gdd�de�Z:dedeee;e;e;e;e;e;e;ffdd�Z<dedee;effd d!�Z=dS)"z�
    sphinx.builders.texinfo
    ~~~~~~~~~~~~~~~~~~~~~~~

    Texinfo builder.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�path)�Any�Dict�Iterable�List�Tuple�Union)�nodes)�OptionParser)�
FileOutput)�Node)�addnodes�package_dir)�Sphinx)�Builder)�Config)�ImageAdapter)�NoUri)�_�__)�logging�progress_message�status_iterator)�	darkgreen)�new_document)�copy_asset_file)�inline_all_toctrees)�SEP�	ensuredir�make_filename_from_project)�TexinfoTranslator�
TexinfoWriter�	templates�texinfoc	@s�eZdZdZdZdZed�Zejdkreed�7Zgd�Z	e
Zd&d	d
�Zde
eeeffdd�Zd'd
ededefdd�Zd'dedededefdd�Zd&dd�Zdeddfdd�Zdededeedejfdd�Zd&dd �Zd!eddfd"d#�Zd&d$d%�ZdS)(�TexinfoBuilderz=
    Builds Texinfo output to create Info documentation.
    r#z$The Texinfo files are in %(outdir)s.�posixzl
Run 'make' in that directory to run these through makeinfo
(use 'make info' here to do that automatically).)z	image/pngz
image/jpegz	image/gif�returnNcCsg|_g|_dS�N)�docnames�
document_data��self�r,�9/usr/lib/python3/dist-packages/sphinx/builders/texinfo.py�init7s
zTexinfoBuilder.initcCsdS)Nz
all documentsr,r*r,r,r-�get_outdated_docs;sz TexinfoBuilder.get_outdated_docs�docname�typcCs||jvr
t||��d|S)N�%)r(r)r+r0r1r,r,r-�get_target_uri>s

zTexinfoBuilder.get_target_uri�from_�tocCs|�||�Sr')r3)r+r4r5r1r,r,r-�get_relative_uriDszTexinfoBuilder.get_relative_uricCs�dd�|jjD�}|st�td��dSg|_|D]2}|d}||jjvr.t�td�|�q|j�	|�|�
td�rA|dd�}|j�	||df�qdS)	NcSsg|]}t|��qSr,)�list)�.0�xr,r,r-�
<listcomp>Isz5TexinfoBuilder.init_document_data.<locals>.<listcomp>zGno "texinfo_documents" config value found; no documents will be writtenrz?"texinfo_documents" config value references unknown document %s�index����)�config�texinfo_documents�logger�warningr�titles�env�all_docsr)�append�endswithr)r+�preliminary_document_data�entryr0r,r,r-�init_document_dataHs"
��z!TexinfoBuilder.init_document_data�ignoredc	Gs�|��|jD]�}|dd�\}}}}|d7}d}}}	t|�dkr,|dd�\}}}	d}
t|�dkr8|d}
tt�|j|�dd�}ttd	�|��|j	j
pQg}|j||
|d
�}
Wd�n1sdwYttd���U|�|
�t
|�}t|jj|fdd
���}||_||_|dd�d|_|j	j|_|p�d|_|	p�d|_|p�d|_||_||
_|�|
|�|�|dd��Wd�n1s�wYqdS)N�z.texi���Fzutf-8)�destination_path�encodingz
processing %s)�
appendices�writingT)�defaults�
components�read_config_filesr<z.info)rIr)�lenrr�join�outdirrrr>�texinfo_appendices�assemble_doctree�post_process_imagesr!r
rC�settings�get_default_values�author�title�texinfo_filename�texinfo_elements�texinfo_dir_entry�texinfo_dir_category�texinfo_dir_descriptionr0�write�copy_image_files)r+rJrHr0�
targetnamer_r^�direntry�description�category�toctree_only�destinationrQ�doctree�	docwriterr\r,r,r-re[sT
��
��



���zTexinfoBuilder.write�	indexfilerkrQc	Cs�t|g|�|_tjt|�ddd�|j�|�}||d<|rBtd�}t�	�}|t�
dd�7}||7}|�tj
�D]}||7}q9|}t||j||t|g�}||d<|D]}	|j�|	�}
|	|
d<|�|
�qSt�d�t�td��|j�|||�|�tj�D]E}|d	}	|d
}t�||�g}
|jD]*\}}|	�|�r�|
�t�td�td���|
�t�||��|
�t�dd��nq�	|�|
�q|S)
N� T��nonlr0z<texinfo output>z<Set title in conf.py>rLzresolving references...�
refdocname�refsectnamez (in �))�setr(r@�inforrC�get_doctreerr	�sectionr_�traverser
�toctreerrEr�resolve_references�pending_xref�emphasisrB�
startswith�Textr�replace_self)r+rorkrQ�tree�new_tree�new_sect�node�	largetreer0�appendix�pendingnode�sectname�newnodes�subdirr_r,r,r-rZ�sN�
�

�zTexinfoBuilder.assemble_doctreecCs|��dSr')�copy_support_filesr*r,r,r-�finish�szTexinfoBuilder.finishrgcCs�|jrat|jj�j}t|jtd�dt|j�|jj|d�D]F}|j|}zt	�
|j|d�}t|�t
t	�
|j|�t	�
||��Wqty`}zt�td�t	�
|j|�|�WYd}~qd}~wwdSdS)Nzcopying images... �brown)�stringify_funcz-figureszcannot copy image file %r: %s)�imagesr�apprC�get_original_image_urirrrV�	verbosityrrWrXrr�srcdir�	Exceptionr@rA)r+rgr��src�dest�imagedir�errr,r,r-rf�s*
�

�
����zTexinfoBuilder.copy_image_filesc
Cs�z-ttd���tjddd�ttj�td�|j	�Wd�WdS1s&wYWdSt
yH}zt�td�|�WYd}~dSd}~ww)Nzcopying Texinfo support filesz	Makefile Trq�Makefilezerror writing file Makefile: %s)rrr@rwr�osrrW�template_dirrX�OSErrorrA)r+r�r,r,r-r��s&���z!TexinfoBuilder.copy_support_files)r&Nr')�__name__�
__module__�__qualname__�__doc__�name�formatr�epilogr��supported_image_typesr �default_translator_classr.r�strrr/r3r6rIrre�boolr	�documentrZr�rfr�r,r,r,r-r$'s&


 %
*r$r>r&cCs$t|j�}|j||j|j|ddfgS)z, Better default texinfo_documents settings. zOne line description of project�
Miscellaneous)r�project�root_docr^)r>�filenamer,r,r-�default_texinfo_documents�s
�r�r�cCsn|�t�|�dtd�|�dgd�|�did�|�dddtg�|�ddd�|�dd	d�d
ddd�S)Nr?rYra�texinfo_domain_indicesT�texinfo_show_urls�footnote�texinfo_no_detailmenuF�builtin)�version�parallel_read_safe�parallel_write_safe)�add_builderr$�add_config_valuer�r7)r�r,r,r-�setup�s
�r�)>r�r�r�typingrrrrrr�docutilsr	�docutils.frontendr
�docutils.ior�docutils.nodesr�sphinxr
r�sphinx.applicationr�sphinx.buildersr�
sphinx.configr�!sphinx.environment.adapters.assetr�
sphinx.errorsr�
sphinx.localerr�sphinx.utilrrr�sphinx.util.consoler�sphinx.util.docutilsr�sphinx.util.fileutilr�sphinx.util.nodesr�sphinx.util.osutilrrr�sphinx.writers.texinfor r!�	getLoggerr�r@rWr�r$r�r�r�r,r,r,r-�<module>s8
 
(