
    ^f                       d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ eeegef         Z G d	 d
e          Z G d d          Z e            Z	 ej        Z	 ej        Z	 ej        ZddZddZ e              e             e                    d            ed          D ]\  ZZ eej        geR   dS )zPattern matching registry.    )annotations)fnmatch)match)Callablecast   )entrypoints)bytes_to_strc                      e Zd ZdZdS )MatcherNotInstalledzMatcher not installed/found.N)__name__
__module____qualname____doc__     ?/var/www/html/env/lib/python3.11/site-packages/kombu/matcher.pyr   r      s        &&&&r   r   c                  J    e Zd ZdZeZdgZddZdd
ZddZddZ		 	 dddZ
dS )MatcherRegistryz#Pattern matching function registry.pcrereturnNonec                "    i | _         d | _        d S )N)	_matchers_default_matcher)selfs    r   __init__zMatcherRegistry.__init__   s    578<r   namestrmatcherMatcherFunctionc                    || j         |<   dS )z$Add matcher by name to the registry.N)r   )r   r   r    s      r   registerzMatcherRegistry.register   s    &tr   c                    	 | j                             |           dS # t          $ r |                     d|           w xY w)z)Remove matcher by name from the registry.No matcher installed for N)r   popKeyErrorr   r   r   s     r   
unregisterzMatcherRegistry.unregister!   sa    	Nt$$$$$ 	 	 	**2D22  	s	    #Ac                x    	 | j         |         | _        dS # t          $ r |                     d|           w xY w)aH  Set 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.
        r%   N)r   r   r'   r   r(   s     r   _set_default_matcherz$MatcherRegistry._set_default_matcher*   sZ    	$(N4$8D!!! 	 	 	**2D22  	s    #9Ndatabytespattern
str | Nonematcher_kwargsdict[str, str] | Noneboolc                ,   |r2| j                             |          s|                     d|           | j         |pd         }|| j        v rt	          |          }t	          |          }nt	          |          }t	          |          } |||fi |pi S )zCall the matcher.r%   glob)r   getr   matcher_pattern_firstr
   )r   r,   r.   r    r0   
match_func	first_arg
second_args           r   r   zMatcherRegistry.match;   s      	4>--g66 	**5G55   ^G$5v6
d000$W--I%d++JJ$T**I%g..Jz)ZHH>3GRHHHr   r   r   )r   r   r    r!   r   r   )r   r   r   r   )NN)
r,   r-   r.   r-   r    r/   r0   r1   r   r2   )r   r   r   r   r   r6   r   r#   r)   r+   r   r   r   r   r   r      s        ---#J= = = =' ' ' '      * #04I I I I I I Ir   r   r   r   c                 F    t                               dt                     dS )z$Register glob into default registry.r4   N)registryr#   r   r   r   r   register_globr=   }   s    fg&&&&&r   c                 l    t                               dt          t          t                               dS )z$Register pcre into default registry.r   N)r<   r#   r   r!   rematchr   r   r   register_pcrer@      s(    fd?G<<=====r   r4   zkombu.matchersNr:   )r   
__future__r   r   rer   r?   typingr   r   utils.compatr	   utils.encodingr
   r   r2   r!   	Exceptionr   r   r<   r#   r)   r=   r@   r+   epargsr   r   r   r   <module>rI      s       " " " " " "             ! ! ! ! ! ! ! ! % % % % % % ( ( ( ( ( (C:t+,' ' ' ' ') ' ' ';I ;I ;I ;I ;I ;I ;I ;I~ ?* 	   
' ' ' '
> > > >   	  f % % % ,--  HBHRWt r   