HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/doc.cpython-310.pyc
o

�N�g��@s2dZddlZddlZe�e�Zdd�Zdd�ZdS)z,
Functions for analyzing/parsing docstrings
�NcCs�|��D]9\}}t�d|�|sq|}dD]\}}z	t�|||�}Wqty4tjd||dd�Yqw||kr=|||<q|S)zA
    Strip/replace reStructuredText directives in docstrings
    zStripping docstring for %s))z *.. code-block:: \S+\n{1,2}�)z	.. note::zNote:)z.. warning::zWarning:)z.. versionadded::zNew in version)z.. versionchanged::zChanged in versionzJException encountered while matching regex %r to docstring for function %sT)�exc_info)�items�log�debug�re�sub�	Exception)Zdocs�func�	docstringZ
docstring_new�regex�repl�r�B/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/doc.py�	strip_rsts(
���rcs�d|i}d}t�||tj�}|r2g}d}|�d�����D]}|�t�||��d��q||d<|Sd�|��}t�fdd	�|D��}|sKg|d<|S|d��d
����	d�}||d<|S)a
    Parse a docstring into its parts.

    Currently only parses dependencies, can be extended to parse whatever is
    needed.

    Parses into a dictionary:
        {
            'full': full docstring,
            'deps': list of dependencies (empty list if none)
        }
    �fullz@([ \t]*):depends:[ \t]+- (\w+)[^\n]*\n(\1[ \t]+- (\w+)[^\n]*\n)*z- (\w+)r��depszRequired python modules: c3s"�|]}|�����r|VqdS)N)�strip�
startswith)�.0�x��txtrr�	<genexpr>Fs� z"parse_docstring.<locals>.<genexpr>rz, )
r�search�M�groupr�
splitlines�append�list�replace�split)r�retr�matchr�line�dataZdep_listrrr�parse_docstring*s&r')�__doc__�loggingr�	getLogger�__name__rrr'rrrr�<module>s