
     h2                     P   d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d de	          Z
 G d	 d
          Z e            Z	 ej        Z	 ej        Z	 ej        Zd Zd Z e              e             e                    d            ed          D ]\  ZZ eej        geR   dS )zPattern matching registry.    )fnmatch)match   )entrypoints)bytes_to_strc                       e Zd ZdZdS )MatcherNotInstalledzMatcher not installed/found.N)__name__
__module____qualname____doc__     I/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/kombu/matcher.pyr	   r	   
   s        &&&&r   r	   c                   <    e Zd ZdZeZdgZd Zd Zd Zd Z	d	dZ
dS )
MatcherRegistryz#Pattern matching function registry.pcrec                 "    i | _         d | _        d S )N)	_matchers_default_matcher)selfs    r   __init__zMatcherRegistry.__init__   s     $r   c                     || j         |<   dS )z$Add matcher by name to the registry.N)r   )r   namematchers      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Nc                 ,   |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   datapatternr   matcher_kwargs
match_func	first_arg
second_args           r   r   zMatcherRegistry.match6   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   )NN)r
   r   r   r   r	   r(   r   r   r"   r$   r   r   r   r   r   r      s~        ---#J% % %' ' '    "I I I I I Ir   r   c                  F    t                               dt                     dS )z$Register glob into default registry.r&   N)registryr   r   r   r   r   register_globr1   r       fg&&&&&r   c                  F    t                               dt                     dS )z$Register pcre into default registry.r   N)r0   r   rematchr   r   r   register_pcrer5   w   r2   r   r&   zkombu.matchersN)r   r   rer   r4   utils.compatr   utils.encodingr   	Exceptionr	   r   r0   r   r"   r1   r5   r$   epargsr   r   r   r   <module>r<      s|                   % % % % % % ( ( ( ( ( (' ' ' ' ') ' ' '5I 5I 5I 5I 5I 5I 5I 5Ir ?* 	   
' ' '
' ' '   	  f % % % ,--  HBHRWt r   