grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026U iÛfAã@sÂdZddlZddlZddlZddlZdddgZddœdd„Zddœd d„Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Ze d¡Ze d¡Zdd„Zdd„Zd d!„Zd"d„ZdS)#zFilename globbing utility.éNÚglobÚiglobÚescapeF©Ú recursivecCstt||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. r)Úlistr)Úpathnamer©r ú)/opt/alt/python38/lib64/python3.8/glob.pyr s cCs2t d||¡t||dƒ}|r.t|ƒr.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. z glob.globF)ÚsysÚauditÚ_iglobÚ _isrecursiveÚnext)rrÚitÚsr r r rs   ccsøtj |¡\}}t|ƒsF|r0tj |¡rB|Vntj |¡rB|VdS|s€|rjt|ƒrjt|||ƒEdHnt|||ƒEdHdS||kržt|ƒržt ||dƒ}n|g}t|ƒrÄ|r¾t|ƒr¾t}qÈt}nt }|D]&}||||ƒD]}tj  ||¡VqÜqÌdS)NT) ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirrÚ_glob2Ú_glob1r Ú_glob0Újoin)rrÚdironlyÚdirnameÚbasenameÚdirsZ glob_in_dirÚnamer r r r )s0    r cCs0tt||ƒƒ}t|ƒs$dd„|Dƒ}t ||¡S)Ncss|]}t|ƒs|VqdS©N)Ú _ishidden)Ú.0Úxr r r Ú Tsz_glob1..)rÚ_iterdirr"ÚfnmatchÚfilter)rÚpatternrÚnamesr r r rQsrcCs8|stj |¡r4|gSntj tj ||¡¡r4|gSgSr!)rrrrr)rrrr r r rWs  rcCs t||dƒS©NF)r©rr)r r r Úglob0dsr-cCs t||dƒSr+)rr,r r r Úglob1gsr.ccs"|dd…Vt||ƒEdHdS)Nr)Ú _rlistdir)rr)rr r r rmsrc cs�|s"t|tƒrttjdƒ}ntj}zRt |¡�>}|D]2}z|rF| ¡rN|jVWq4tk rdYq4Xq4W5QRXWntk rŠYdSXdS)NÚASCII)Ú isinstanceÚbytesrÚcurdirÚscandirÚis_dirr ÚOSError)rrrÚentryr r r r&ts    r&ccs`tt||ƒƒ}|D]H}t|ƒs|V|r6tj ||¡n|}t||ƒD]}tj ||¡VqDqdSr!)rr&r"rrrr/)rrr*r$rÚyr r r r/†sr/z([*?[])s([*?[])cCs(t|tƒrt |¡}n t |¡}|dk Sr!)r1r2Úmagic_check_bytesÚsearchÚ magic_check)rÚmatchr r r r“s   rcCs |ddkS)Nr)Ú.é.r )rr r r r"šsr"cCst|tƒr|dkS|dkSdS)Ns**z**)r1r2)r)r r r r�s rcCs<tj |¡\}}t|tƒr(t d|¡}n t d|¡}||S)z#Escape all special characters. s[\1]z[\1])rrÚ splitdriver1r2r9Úsubr;)rZdriver r r r£s   )Ú__doc__rÚrer'r Ú__all__rrr rrr-r.rr&r/Úcompiler;r9rr"rrr r r r Ús*  (