a c@sdZddlZddlZddlZgdZdddZdddZd d Zd d Zd dZ ddZ ddZ e dZ e dZddZddZddZdS)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)globiglobescapeFcCstt||dS)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)pathnamerr\/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/setuptools/glob.pyrs rcCs*t||}|r&t|r&t|}|r&J|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)rritsrrr rs  rccstj|\}}t|sF|r0tj|rB|Vntj|rB|VdS|s|rnt|rnt||D] }|Vq`nt||D] }|VqxdS||krt|rt ||}n|g}t|r|rt|rt}qt}nt }|D]$}|||D]}tj ||VqqdSN) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirs glob_in_dirnamerrr r 0s4      r cCsT|s"t|trtjd}ntj}zt|}WntyFgYS0t||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr r[s   rcCs8|stj|r4|gSntjtj||r4|gSgSr)rrrrr)rrrrr rhs  rccs2t|s J|ddVt|D] }|Vq"dS)Nr)r _rlistdir)rr*rrrr rxs  rccs|s"t|trtjd}ntj}zt|}WntjyFYdS0|D]>}|V|rhtj||n|}t |D]}tj||VqtqLdSr ) r"r#rr$r%r&errorrrr,)rr+rryrrr r,s  r,z([*?[])s([*?[])cCs(t|trt|}n t|}|duSr)r"r#magic_check_bytessearch magic_check)rmatchrrr rs   rcCst|tr|dkS|dkSdS)Ns**z**)r"r#)r*rrr r s r cCs<tj|\}}t|tr(td|}n td|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver"r#r/subr1)rdriverrr rs   r)F)F)__doc__rrer(__all__rrr rrrr,compiler1r/rr rrrrr s   +