U +a @sdZddlZddlZddlZdddgZdddZdddZd 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. NglobiglobescapeFcCstt||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)pathnamerr7/tmp/pip-install-1bd_1mtk/setuptools/setuptools/glob.pyrs cCs*t||}|r&t|r&t|}|r&t|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 _isrecursivenextAssertionError)rritsrrr rs  ccstj|\}}|r t|r tnt}t|sZ|rDtj|rV|Vntj|rV|VdS|sr|||EdHdS||krt|rt ||}n|g}t|st }|D]$}|||D]}tj ||VqqdSN) ospathsplitr glob2glob1 has_magiclexistsisdirr glob0join)rrdirnamebasename glob_in_dirdirsnamerrr r 0s(   r cCsV|s"t|trtjd}ntj}zt|}Wntk rHgYSXt||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr rTs  rcCs8|stj|r4|gSntjtj||r4|gSgSr)rrrrr)rrrrr ras  rccs2t|s t|ddVt|D] }|Vq"dS)Nr)r r _rlistdir)rr*xrrr rqs  rccs|s"t|trtjd}ntj}zt|}Wntjk rHYdSX|D]>}|V|rjtj||n|}t |D]}tj||VqvqNdSr ) r"r#rr$r%r&errorrrr,)rr+r-ryrrr r,ys  r,z([*?[])s([*?[])cCs(t|trt|}n t|}|dk Sr)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#r0subr2)rdriverrr rs   )F)F)__doc__rrer(__all__rrr rrrr,compiler2r0rr rrrrr s    $