
    ϶vg
                         d dl Z d dlZe j         ee j                   ee j                  z  z   Z G d d          Zd ZdS )    Nc                   R    e Zd ZU dZeed<   efdefdZd Zd Z	d Z
d Zd Zd	 Zd
S )
Translatorz
    >>> Translator('xyz')
    Traceback (most recent call last):
    ...
    AssertionError: Invalid separators

    >>> Translator('')
    Traceback (most recent call last):
    ...
    AssertionError: Invalid separators
    sepsc                 v    |r%t          |          t          t                    k    s
J d            || _        d S )NzInvalid separators)set_default_sepsr   )selfr   s     Y/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/_vendor/zipp/glob.py__init__zTranslator.__init__   s:    MD		S%7%77779M777			    c                 R    |                      |                     |                    S )zH
        Given a glob pattern, produce a regex that matches it.
        )extendtranslate_corer	   patterns     r
   	translatezTranslator.translate   s$     {{4..w77888r   c                     d| dS )z
        Extend regex for pattern-wide concerns.

        Apply '(?s:)' to create a non-matching group that
        matches newlines (valid on Unix).

        Append '\Z' to imply fullmatch even when match is used.
        z(?s:z)\Z r   s     r
   r   zTranslator.extend!   s     $w####r   c           
          |                      |           d                    t          | j        t	          |                     |                                        S )a?  
        Given a glob pattern, produce a regex that matches it.

        >>> t = Translator()
        >>> t.translate_core('*.txt').replace('\\\\', '')
        '[^/]*\\.txt'
        >>> t.translate_core('a?txt')
        'a[^/]txt'
        >>> t.translate_core('**/*').replace('\\\\', '')
        '.*/[^/][^/]*'
         )restrict_rglobjoinmapreplaceseparatestar_not_emptyr   s     r
   r   zTranslator.translate_core,   sL     	G$$$wws4<$2E2Eg2N2N)O)OPPQQQr   c                 (   |                     d          p}t          j        |                     d                                        dd                              ddt          j        | j                   d                              dd	          S )
zM
        Perform the replacements for a match from :func:`separate`.
        r   r   z\*\*z.*z\*[^z]*z\?z[^/])groupreescaper   r   )r	   matchs     r
   r   zTranslator.replace;   sy     {{5!! 
Iekk!nn%%WXu%%WU:")DI"6"6:::;;WUG$$		
r   c                     dt          j        | j                   d}t          j        ||          }t	          d |D                       rt          d          dS )z
        Raise ValueError if ** appears in anything but a full path segment.

        >>> Translator().translate('**foo')
        Traceback (most recent call last):
        ...
        ValueError: ** must appear alone in a path segment
        []+c              3   *   K   | ]}d |v o|d k    V  dS )z**Nr   ).0segments     r
   	<genexpr>z,Translator.restrict_rglob.<locals>.<genexpr>Q   s/      KKwtw27d?KKKKKKr   z&** must appear alone in a path segmentN)r    r!   r   splitany
ValueError)r	   r   seps_patternsegmentss       r
   r   zTranslator.restrict_rglobF   sl     5BIdi004448L'22KK(KKKKK 	GEFFF	G 	Gr   c                 n    d }dt          j        | j                   d}t          j        |||          S )z@
        Ensure that * will not match an empty segment.
        c                 @    |                      d          }|dk    rdn|S )Nr   *z?*)r   )r"   r(   s     r
   handle_segmentz1Translator.star_not_empty.<locals>.handle_segmentY   s#    kk!nnG"c>>44w6r   r   r%   )r    r!   r   sub)r	   r   r2   not_seps_patterns       r
   r   zTranslator.star_not_emptyT   sE    
	7 	7 	7 :49!5!5999v&@@@r   N)__name__
__module____qualname____doc__str__annotations__r   r   r   r   r   r   r   r   r   r   r
   r   r      s         
 
 III#0  S    9 9 9	$ 	$ 	$R R R	
 	
 	
G G G
A 
A 
A 
A 
Ar   r   c                 ,    t          j        d|           S )z
    Separate out character sets to avoid translating their contents.

    >>> [m.group(0) for m in separate('*.txt')]
    ['*.txt']
    >>> [m.group(0) for m in separate('a[?]txt')]
    ['a', '[?]', 'txt']
    z+([^\[]+)|(?P<set>[\[].*?[\]])|([\[][^\]]*$))r    finditer)r   s    r
   r   r   a   s     ;EwOOOr   )	osr    sepr9   altsepboolr   r   r   r   r   r
   <module>rA      s    				 				 RY$$ry//99VA VA VA VA VA VA VA VAr	P 	P 	P 	P 	Pr   