grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B T�Ý®½/šã@sºdZddlZddlZddlZdddgZddœdd„Zddœd d„Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„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/python37/lib64/python3.7/glob.pyr s cCs$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. F)Ú_iglobÚ _isrecursiveÚnext)rrÚitÚsrrr rs  ccstj |¡\}}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 }x2|D]*}x$||||ƒD]}tj  ||¡VqàWqÎWdS)NT) ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirr Ú_glob2Ú_glob1r Ú_glob0Újoin)rrÚdironlyÚdirnameÚbasenameÚdirsZ glob_in_dirÚnamerrr r 's0     r cCs0tt||ƒƒ}t|ƒs$dd„|Dƒ}t ||¡S)Ncss|]}t|ƒs|VqdS)N)Ú _ishidden)Ú.0Úxrrr ú Rsz_glob1..)rÚ_iterdirrÚfnmatchÚfilter)rÚpatternrÚnamesrrr rOsrcCs8|stj |¡r4|gSntj tj ||¡¡r4|gSgS)N)rrrrr)rrrrrr rUs  rcCs t||dƒS)NF)r)rr%rrr Úglob0bsr'cCs t||dƒS)NF)r)rr%rrr Úglob1esr(ccs"|dd…Vt||ƒEdHdS)Nr)Ú _rlistdir)rr%rrrr rksrc cs’|s"t|tƒrttjdƒ}ntj}yVt |¡�B}x:|D]2}y|rH| ¡rP|jVWq6tk rfYq6Xq6WWdQRXWntk rŒdSXdS)NÚASCII)Ú isinstanceÚbytesrÚcurdirÚscandirÚis_dirrÚOSError)rrr Úentryrrr r"rs     r"ccshtt||ƒƒ}xT|D]L}t|ƒs|V|r8tj ||¡n|}x"t||ƒD]}tj ||¡VqHWqWdS)N)rr"rrrrr))rrr&r rÚyrrr r)„s r)z([*?[])s([*?[])cCs(t|tƒrt |¡}n t |¡}|dk S)N)r+r,Úmagic_check_bytesÚsearchÚ magic_check)rÚmatchrrr r‘s   rcCs |ddkS)Nr)Ú.é.r)rrrr r˜srcCst|tƒr|dkS|dkSdS)Ns**z**)r+r,)r%rrr r ›s r cCs<tj |¡\}}t|tƒr(t d|¡}n t d|¡}||S)z#Escape all special characters. s[\1]z[\1])rrÚ splitdriver+r,r3Úsubr5)rZdriverrr r¡s   )Ú__doc__rÚrer#Ú__all__rrr rrr'r(rr"r)Úcompiler5r3rrr rrrrr Ús(  (