~fdZddlZddlZddlZgdZddZddZdZdZdZ d Z d Z ejd Z ejd Zd ZdZdZy)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. N)globiglobescapec.tt||S)ayReturn 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)pathnamers X/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/setuptools/glob.pyrrs h)4 55cVt||}|rt|rt|}|rJ|S)aReturn 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 _isrecursivenext)r ritss r rrs/ ) $B\(+ H u Ir c#(Ktjj|\}}|rt|rtnt }t |sJ|r$tjj|r|ytjj|r|y|s|||Ed{y||k7rt |r t||}n|g}t |st}|D]2}|||D]$}tjj||&4y7nwN) ospathsplitrglob2glob1 has_magiclexistsisdirr glob0join)r rdirnamebasename glob_in_dirdirsnames r r r 0s h/GX$h)?%UK X  wwx( ww}}W% w111(y1gy)y X  2D'',,w- -3 2sBD!D"A/Dc|s@t|tr tjj d}ntj} tj |}tj||S#t $rgcYSwxYwNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamess r rrTsh  gu %ii&&w/GiiG 7# >>% ))  sA// A=<A=c|s$tjj|r|gSgStjjtjj ||r|gSgSr)rrrrr)rrs r rrasT  77== !:  I 77??277<<: ;:  Ir c#^Kt|sJ|ddt|Ed{y7w)Nr)r _rlistdir)rr.s r rrqs.   "1+!!!s #-+-c#K|s@t|tr tjj d}ntj} tj |}|D]\}||r tjj||n|}t|D]$}tjj||&^y#t $rYywxYwwr$) r&r'rr(r)r*r+rrr2)rr/xrys r r2r2xs  gu %ii&&w/GiiG 7#+2rww||GQ'4A'',,q!$ $! s+AC B=A"C = C C C  C z([*?[])s([*?[])ct|trtj|}|duStj|}|duSr)r&r'magic_check_bytessearch magic_check)rmatchs r rrsF!U!((+  ""1%  r c6t|tr|dk(S|dk(S)Ns**z**)r&r')r.s r rrs!'5!%$r ctjj|\}}t|trt j d|}||zStj d|}||zS)zEscape all special characters.s[\1]z[\1])rr splitdriver&r'r7subr9)r drives r rrsbgg((2OE8(E"$((8< 8 ??7H5 8 r )F)__doc__rrer,__all__rrr rrrr2compiler9r7rrrr r rEsp  % 6$.H *  "%"bjj# BJJz* r