3 K”ReWã@sždZddlZddlZddlZddlmZdddgZddd„Zdd d„Zd d „Z d d „Z dd„Z dd„Z dd„Z ejdƒZejdƒZdd„Zdd„Zdd„ZdS)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_typeÚglobÚiglobÚescapeFcCstt||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)Úpathnamer©r ú…/builddir/build/BUILDROOT/alt-python36-setuptools-38.5.2-7.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/setuptools/glob.pyrs cCs,t||ƒ}|r(t|ƒr(t|ƒ}| s(t‚|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ÚAssertionError)rrÚitÚsr r r r s   ccs tjj|ƒ\}}t|ƒsF|r0tjj|ƒrB|Vntjj|ƒrB|VdS|s�|rrt|ƒrrx4t||ƒD] }|VqbWnxt||ƒD] }|Vq~WdS||kr¬t|ƒr¬t ||ƒ}n|g}t|ƒrÒ|rÌt|ƒrÌt}qÖt}nt }x0|D](}x"|||ƒD]}tjj ||ƒVqìWqÜWdS)N) ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirr Úglob2Úglob1r Úglob0Újoin)rrÚdirnameÚbasenameÚxÚdirsÚ glob_in_dirÚnamer r r r 2s4        r c CsR|s"t|tƒrtjjdƒ}ntj}ytj|ƒ}Wntk rDgSXtj||ƒS)NÚASCII) Ú isinstancerrÚcurdirÚencodeÚlistdirÚOSErrorÚfnmatchÚfilter)rÚpatternÚnamesr r r r]s rcCs8|stjj|ƒr4|gSntjjtjj||ƒƒr4|gSgS)N)rrrrr)rrr r r rjs  rccs6t|ƒs t‚|dd…Vxt|ƒD] }|Vq$WdS)Nr)r rÚ _rlistdir)rr)rr r r rzs rc cs˜|s"t|tƒrttjdƒ}ntj}ytj|ƒ}Wntjk rFdSXxJ|D]B}|V|rjtjj||ƒn|}x t|ƒD]}tjj||ƒVqxWqNWdS)Nr!) r"rrr#r%Úerrorrrr+)rr*rrÚyr r r r+‚s  r+z([*?[])s([*?[])cCs(t|tƒrtj|ƒ}n tj|ƒ}|dk S)N)r"rÚmagic_check_bytesÚsearchÚ magic_check)rÚmatchr r r r—s   rcCst|tƒr|dkS|dkSdS)Ns**z**)r"r)r)r r r r Ÿs r cCs<tjj|ƒ\}}t|tƒr(tjd|ƒ}n tjd|ƒ}||S)z#Escape all special characters. s[\1]z[\1])rrÚ splitdriver"rr.Úsubr0)rÚdriver r r r¦s   )F)F)Ú__doc__rÚrer'Zsetuptools.extern.sixrÚ__all__rrr rrrr+Úcompiler0r.rr rr r r r Ús"    +