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/util/__pycache__/matching.cpython-310.pyc
o

�$�a��	@s�UdZddlZddlmZmZmZmZmZmZm	Z	ddl
mZdedefdd�Z
d	eedeeegeeeffd
d�ZGdd
�d
�Zedg�ZiZeee	fed<dededeeefdd�Zdeededeefdd�ZdS)z�
    sphinx.util.matching
    ~~~~~~~~~~~~~~~~~~~~

    Pattern-matching utility functions for Sphinx.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Callable�Dict�Iterable�List�Match�Optional�Pattern)�
canon_path�pat�returncCstdt|�}}d}||kr�||}|d7}|dkr1||kr,||dkr,|d7}|d}n�|d}n�|dkr:|d}nx|d	kr�|}||krN||d
krN|d7}||kr\||dkr\|d7}||krt||dkrt|d7}||krt||dksf||kr}|d}n5|||��d
d�}|d}|dd
kr�d|dd�}n
|ddkr�d
|}d||f}n|t�|�7}||ks
|dS)z�Translate a shell-style glob pattern to a regular expression.

    Adapted from the fnmatch module, but enhanced so that single stars don't
    match slashes.
    r���*z.*z[^/]*�?z[^/]�[�!�]z\[�\z\\z^/N�^z%s[%s]�$)�len�replace�re�escape)r
�i�n�res�c�j�stuff�r �6/usr/lib/python3/dist-packages/sphinx/util/matching.py�_translate_patternsB


�
�#r"�patternscCsdd�|D�S)NcSsg|]
}t�t|��j�qSr )r�compiler"�match��.0r
r r r!�
<listcomp>@sz$compile_matchers.<locals>.<listcomp>r )r#r r r!�compile_matchers?sr)c@sJeZdZdZdeeddfdd�Zdedefdd	�Zdedefd
d�Z	dS)�Matcherz�A pattern matcher for Multiple shell-style glob patterns.

    Note: this modifies the patterns to work with copy_asset().
          For example, "**/index.rst" matches with "index.rst"
    r#rNcCs dd�|D�}t||�|_dS)NcSs"g|]
}|�d�r|dd��qS)z**/�N)�
startswithr&r r r!r(Ks"z$Matcher.__init__.<locals>.<listcomp>)r)r#)�selfr#�expandedr r r!�__init__JszMatcher.__init__�stringcCs
|�|�S�N)r%�r-r0r r r!�__call__Ns
zMatcher.__call__cs t���t�fdd�|jD��S)Nc3s�|]}|��VqdSr1r r&�r0r r!�	<genexpr>Ss�z Matcher.match.<locals>.<genexpr>)r	�anyr#r2r r4r!r%Qsz
Matcher.match)
�__name__�
__module__�__qualname__�__doc__r�strr/�boolr3r%r r r r!r*Cs
r*z**/.*�
_pat_cache�namecCs(|tvr
t�t|��t|<t|�|�S)zbReturn if name matches the regular expression (pattern)
    ``pat```. Adapted from fnmatch module.)r=rr$r"r%)r>r
r r r!�patmatch\sr?�namescCs2|tvr
t�t|��t|<t|j}tt||��S)z�Return the subset of the list ``names`` that match
    the regular expression (pattern) ``pat``.

    Adapted from fnmatch module.
    )r=rr$r"r%�list�filter)r@r
r%r r r!�	patfilterds
rC)r:r�typingrrrrrrr�sphinx.util.osutilr	r;r"r)r*�DOTFILESr=�__annotations__r?rCr r r r!�<module>s
$,.
"