U âQabÜ ã @ s’ d Z ddlZddlZddlZdddgZddd„Zddd„Zd d „ Zdd„ Zd d„ Z dd„ Z dd„ Ze d¡Z e d¡Zdd„ Zdd„ Zdd„ ZdS )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ÚglobÚiglobÚescapeFc C s t t| |d�ƒS )ay Return 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 ú3/usr/lib/python3.8/site-packages/setuptools/glob.pyr s c C s" t | |ƒ}|rt| ƒrt|ƒ}|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)r r ÚitÚsr r r r s c c sü t j | ¡\}}t| ƒsF|r0t j | ¡rB| V nt j |¡rB| V d S |sˆ|rnt|ƒrnt||ƒD ] }|V q`nt||ƒD ] }|V qxd S || kr¤t|ƒr¤t ||ƒ}n|g}t|ƒrÊ|rÄt|ƒrÄt}qÎt}nt }|D ]$}|||ƒD ]}t j ||¡V qàqÒd S ©N)ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirr Úglob2Úglob1r Úglob0Újoin)r r ÚdirnameÚbasenameÚxÚdirsZglob_in_dirÚnamer r r r 0 s4 r c C sV | s"t |tƒrtj d¡} ntj} zt | ¡}W n tk rH g Y S X t ||¡S ©NÚASCII) Ú isinstanceÚbytesr ÚcurdirÚencodeÚlistdirÚOSErrorÚfnmatchÚfilter)r ÚpatternÚnamesr r r r [ s r c C s8 |st j | ¡r4|gS nt j t j | |¡¡r4|gS g S r )r r r r r )r r r r r r h s r c c s&