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 cCs:t d||¡t||dƒ}|r6t|ƒr6t|ƒ}|r6t‚|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ÚAssertionError)rrÚitÚsr r r rs   ccstj |¡\}}t|ƒsN|r t‚|r8tj |¡rJ|Vntj |¡rJ|VdS|sˆ|rrt|ƒrrt|||ƒ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_magicrÚlexistsÚisdirrÚ_glob2Ú_glob1r Ú_glob0Újoin)rrÚdironlyÚdirnameÚbasenameÚdirsZ glob_in_dirÚnamer r r r )s2    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.t|ƒs t‚|dd…Vt||ƒEdHdS)Nr)rrÚ _rlistdir)rr*rr r r rms rc 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#rrrr0)rrr+r%rÚyr r r r0†sr0z([*?[])s([*?[])cCs(t|tƒrt |¡}n t |¡}|dk Sr")r2r3Ú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**)r2r3)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Ú splitdriver2r3r:Úsubr<)rZdriver r r r£s   )Ú__doc__rÚrer(r Ú__all__rrr rrr.r/rr'r0Úcompiler<r:rr#rrr r r r Ús*  (