
    ,h                    t   d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
mZmZ e
r
ddlmZmZmZ g dZdddZddd	Zdd
Zedd       Zedd       ZddZd Zed d       Zed!d       Zd"dZed#d       Zed$d       Zd%dZ ej2                  d      Z ej2                  d      Zd&dZd'dZd Zy)(z
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * Hidden files are not ignored.
    )annotationsN)IterableIterator)TYPE_CHECKINGAnyStroverload)	BytesPathStrOrBytesPathStrPath)globiglobescapec                .    t        t        | |            S )ay  Return a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )	recursive)listr   )pathnamer   s     Q/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/glob.pyr   r      s     h)455    c                V    t        | |      }|rt        |       rt        |      }|rJ |S )a  Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )_iglob_isrecursivenext)r   r   itss       r   r   r   %   s-     
)	$B\(+HIr   c              #  (  K   t         j                  j                  |       \  }}|rt        |      rt        nt
        }t        |       sJ|r$t         j                  j                  |       r|  y t         j                  j                  |      r|  y |s |||      E d {    y || k7  rt        |      rt        ||      }n|g}t        |      st        }|D ]2  } |||      D ]$  }t         j                  j                  ||       & 4 y 7 nwN)ospathsplitr   glob2glob1	has_magiclexistsisdirr   glob0join)r   r   dirnamebasenameglob_in_dirdirsnames          r   r   r   7   s     h/GX$h)?%UKXwwx(
 	 ww}}W%w111 (y1!'!;yX .2 	.D'',,w--	.. 	2s   BD!D"A/Dc                     y r    r'   patterns     r   r!   r!   [   s    8;r   c                     y r   r-   r.   s     r   r!   r!   ]   s    >Ar   c                    | s@t        |t              r t        j                  j	                  d      } nt        j                  } 	 t        j
                  |       }t        j                  ||      S # t        $ r g cY S w xY wNASCII)	
isinstancebytesr   curdirencodelistdirOSErrorfnmatchfilter)r'   r/   namess      r   r!   r!   _   sh    gu%ii&&w/GiiG

7# >>%))  	s   A/ /A=<A=c                    |s$t         j                  j                  |       r|gS g S t         j                  j                  t         j                  j	                  | |            r|gS g S r   )r   r   r$   r#   r&   )r'   r(   s     r   r%   r%   m   sT     77==!: I 77??277<<:;:Ir   c                     y r   r-   r.   s     r   r    r    }   s    <?r   c                     y r   r-   r.   s     r   r    r       s    BEr   c              #  ^   K   t        |      sJ |d d  t        |       E d {    y 7 w)Nr   )r   	_rlistdirr.   s     r   r    r       s+       
"1+!!!s   #-+-c                     y r   r-   r'   s    r   rA   rA      s    25r   c                     y r   r-   rC   s    r   rA   rA      s    69r   c              #    K   | s@t        | t              r t        j                  j	                  d      } nt        j                  } 	 t        j
                  |       }|D ]\  }| | r t        j                  j                  | |      n|}t        |      D ]$  }t        j                  j                  ||       & ^ y # t        $ r Y y w xY wwr2   )
r4   r5   r   r6   r7   r8   r9   r   r&   rA   )r'   r<   xr   ys        r   rA   rA      s     gu%ii&&w/GiiG

7#  %+2rww||GQ'4 	%A'',,q!$$	%	%  s+   ACB= A"C=	C	CC		Cz([*?[])s   ([*?[])c                ~    t        | t              rt        j                  |       d uS t        j                  |       d uS r   )r4   r5   magic_check_bytessearchmagic_check)r   s    r   r"   r"      s8    !U ''*$66!!!$D00r   c                6    t        | t              r| dk(  S | dk(  S )Ns   **z**)r4   r5   )r/   s    r   r   r      s!    '5!%$r   c                    t         j                  j                  |       \  }} t        | t              rt
        j                  d|       } || z   S t        j                  d|       } || z   S )zEscape all special characters.s   [\1]z[\1])r   r   
splitdriver4   r5   rI   subrK   )r   drives     r   r   r      sb     gg((2OE8(E"$((8< 8 ??7H58r   )F)r   r   r   boolreturnzlist[AnyStr])r   r   r   rQ   rR   zIterator[AnyStr])r'   r   r/   strrR   z	list[str])r'   r	   r/   r5   rR   zlist[bytes])r'   r
   r/   str | bytesrR   zlist[str] | list[bytes])r'   r   r/   rS   rR   Iterator[str])r'   r	   r/   r5   rR   Iterator[bytes])r'   r
   r/   rT   rR   Iterator[str | bytes])r'   r   rR   rU   )r'   r	   rR   rV   )r'   r
   rR   rW   )r   rT   rR   rQ   )r/   rT   rR   rQ   )__doc__
__future__r   r:   r   recollections.abcr   r   typingr   r   r   	_typeshedr	   r
   r   __all__r   r   r   r!   r%   r    rA   compilerK   rI   r"   r   r   r-   r   r   <module>r`      s    #  	 	 . 2 2<<
%6$.H 
 ; 
 ;	 A 
 A*	  
 ? 
 ?	 E 
 E" 
 5 
 5	 9 
 9%$ bjj#BJJz* 1	r   