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/ext/__pycache__/ifconfig.cpython-310.pyc
o

�$�a?
�@s�dZddlmZmZmZddlmZddlmZddl	Z	ddl
mZddlm
Z
ddlmZdd	lmZGd
d�dej�ZGdd
�d
e
�Zdedejdeddfdd�Zdedeeeffdd�ZdS)a�
    sphinx.ext.ifconfig
    ~~~~~~~~~~~~~~~~~~~

    Provides the ``ifconfig`` directive that allows to write documentation
    that is included depending on configuration variables.

    Usage::

        .. ifconfig:: releaselevel in ('alpha', 'beta', 'rc')

           This stuff is only included in the built docs for unstable versions.

    The argument for ``ifconfig`` is a plain Python expression, evaluated in the
    namespace of the project configuration (that is, all variables from
    ``conf.py`` are available.)

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�Any�Dict�List)�nodes)�NodeN)�Sphinx)�SphinxDirective)�nested_parse_with_titles)�
OptionSpecc@seZdZdS)�ifconfigN)�__name__�
__module__�__qualname__�rr�5/usr/lib/python3/dist-packages/sphinx/ext/ifconfig.pyr"src@s<eZdZUdZdZdZdZiZee	d<de
efdd�ZdS)	�IfConfigT�r�option_spec�returncCs>t�}|jj|_|�|�|jd|d<t|j|j|�|gS)Nr�expr)r�state�document�set_source_info�	argumentsr	�content)�self�noderrr�run.s

zIfConfig.runN)
rr
r�has_content�required_arguments�optional_arguments�final_argument_whitespacerr
�__annotations__rrrrrrrr&s
r�app�doctree�docnamerc
Cs�dd�|jD�}|�|jj���|jj|d<|�t�D]J}z	t|d|�}Wn0t	yW}z$ddl
m}d�||j
|��}|jjd||d	�}	|�|	�WYd}~qd}~ww|s`|�g�q|�|j�qdS)
NcSsi|]}|j|j�qSr)�name�value)�.0�confvalrrr�
<dictcomp>8sz*process_ifconfig_nodes.<locals>.<dictcomp>�builderrr)�format_exception_only�z.Exception occurred in ifconfig expression: 
%s)�	base_node)�config�update�__dict__�copyr+r&�traverser�eval�	Exception�	tracebackr,�join�	__class__�reporter�error�replace_self�children)
r#r$r%�nsr�res�errr,�msg�newnoderrr�process_ifconfig_nodes7s*����	�rBcCs.|�t�|�dt�|�dt�tjdd�S)Nrzdoctree-resolvedT)�version�parallel_read_safe)�add_noder�
add_directiver�connectrB�sphinx�__display_version__)r#rrr�setupMs
rJ)�__doc__�typingrrr�docutilsr�docutils.nodesrrH�sphinx.applicationr�sphinx.util.docutilsr�sphinx.util.nodesr	�sphinx.util.typingr
�Elementrrr�strrBrJrrrr�<module>s