HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/kombu/__pycache__/matcher.cpython-310.pyc
o

'we��@s�dZddlmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
eeegefZGd	d
�d
e�ZGdd�d�Ze�Z	ejZ	ejZ	ejZddd�Zddd�Ze�e�e�d�ed�D]
\ZZeejge�R�qgdS)zPattern matching registry.�)�annotations)�fnmatch)�match)�Callable�cast�)�entrypoints)�bytes_to_strc@seZdZdZdS)�MatcherNotInstalledzMatcher not installed/found.N)�__name__�
__module__�__qualname__�__doc__�rr�F/home/arjun/projects/env/lib/python3.10/site-packages/kombu/matcher.pyr
sr
c@sReZdZdZeZdgZddd�Zddd�Zdd
d�Zddd�Z			dddd�Z
dS) �MatcherRegistryz#Pattern matching function registry.�pcre�return�NonecCsi|_d|_dS)N)�	_matchers�_default_matcher)�selfrrr�__init__s
zMatcherRegistry.__init__�name�str�matcher�MatcherFunctioncCs||j|<dS)z$Add matcher by name to the registry.N)r)rrrrrr�registerszMatcherRegistry.registercCs2z	|j�|�WdSty|�d|����w)z)Remove matcher by name from the registry.�No matcher installed for N)r�pop�KeyErrorr
�rrrrr�
unregister!s��zMatcherRegistry.unregistercCs2z	|j||_WdSty|�d|����w)aHSet the default matching method.

        :param name: The name of the registered matching method.
            For example, `glob` (default), `pcre`, or any custom
            methods registered using :meth:`register`.

        :raises MatcherNotInstalled: If the matching method requested
            is not available.
        rN)rrr r
r!rrr�_set_default_matcher*s
��z$MatcherRegistry._set_default_matcherN�data�bytes�pattern�
str | None�matcher_kwargs�dict[str, str] | None�boolcCsp|r|j�|�s|�d|����|j|pd}||jvr%t|�}t|�}nt|�}t|�}|||fi|p5i��S)zCall the matcher.r�glob)r�getr
�matcher_pattern_firstr	)rr$r&rr(�
match_func�	first_arg�
second_argrrrr;s�

zMatcherRegistry.match�rr)rrrrrr)rrrr)NN)
r$r%r&r%rr'r(r)rr*)rrr
rr
r-rrr"r#rrrrrrs



	�rrrcCst�dt�dS)z$Register glob into default registry.r+N)�registryrrrrrr�
register_glob}sr3cCst�dttt��dS)z$Register pcre into default registry.rN)r2rrr�rematchrrrr�
register_pcre�sr5r+zkombu.matchersNr1)r�
__future__rr�rerr4�typingrr�utils.compatr�utils.encodingr	rr*r�	Exceptionr
rr2rr"r3r5r#�ep�argsrrrrr�<module>s2?


�