ReW@sdZddlZddlZddlZddlmZdddgZdddZdd dZd d Z d d Z ddZ ddZ ddZ ejdZejdZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. N) binary_typeglobiglobescapeFcCstt|d|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)pathnamerr /builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/glob.pyrs cCs>t||}|r:t|r:t|}| s: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)rritsr r r r s   ccshtjj|\}}t|s_|rDtjj|r[|Vntjj|r[|VdS|s|rt|rx>t||D] }|VqWnxt||D] }|VqWdS||krt|rt ||}n |g}t|r|rt|rt}q%t}nt }x<|D]4}x+|||D]}tjj ||VqBWq,WdS)N) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirs glob_in_dirnamer r r r 2s4        r c Cso|s3t|tr*tjjd}n tj}ytj|}Wntk r^gSYnXtj||S)NASCII) isinstancerrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesr r r r]s   rcCsN|s"tjj|rJ|gSn(tjjtjj||rJ|gSgS)N)rrrrr)rrr r r rjs  !rccsAt|st|ddVxt|D] }|Vq.WdS)Nr)r r _rlistdir)rr)rr r r rzsrc cs|s3t|tr*ttjd}n tj}ytj|}Wntjk radSYnXx_|D]W}|V|rtjj||n|}x(t|D]}tjj||VqWqiWdS)Nr!) r"rrr#r%errorrrr+)rr*rryr r r r+s   !r+z([*?[])s([*?[])cCs:t|tr!tj|}ntj|}|dk S)N)r"rmagic_check_bytessearch magic_check)rmatchr r r rsrcCs't|tr|dkS|dkSdS)Ns**z**)r"r)r)r r r r s r cCsVtjj|\}}t|tr<tjd|}ntjd|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver"rr.subr0)rdriver r r rs )__doc__rrer'Zsetuptools.extern.sixr__all__rrr rrrr+compiler0r.rr rr r r r s"    +