grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026î   f… ã@s¬dZddlZddlZddlZddgZdd„Zdd„Zdd„Zd d „Zej d ƒZ ej d ƒZ d d„Z dd„Z dd„ZdS)zFilename globbing utility.éNÚglobÚiglobcCstt|ƒƒS)aReturn 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. )Úlistr)Úpathname©rú)/opt/alt/python34/lib64/python3.4/glob.pyr s ccstjj|ƒ\}}t|ƒse|rGtjj|ƒra|Vqantjj|ƒra|VndS|s�td|ƒDdHdS||kr¨t|ƒr¨t|ƒ}n |g}t|ƒrÆt}nt}x<|D]4}x+|||ƒD]}tjj ||ƒVqéWqÓWdS)aReturn 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. N) ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirÚglob1rÚglob0Újoin)rÚdirnameÚbasenameÚdirsZ glob_in_dirÚnamerrrrs(       c Cs”|s6t|tƒr*ttjdƒ}q6tj}nytj|ƒ}Wntk ragSYnXt|ƒs„dd„|Dƒ}ntj||ƒS)NÚASCIIcSs"g|]}t|ƒs|‘qSr)Ú _ishidden)Ú.0Úxrrrú Hs zglob1..) Ú isinstanceÚbytesrÚcurdirÚlistdirÚOSErrorrÚfnmatchÚfilter)rÚpatternÚnamesrrrr=s    rcCsN|s"tjj|ƒrJ|gSn(tjjtjj||ƒƒrJ|gSgS)N)rr r r r)rrrrrrKs  !rz([*?[])s([*?[])cCs:t|tƒr!tj|ƒ}ntj|ƒ}|dk S)N)rrÚmagic_check_bytesÚsearchÚ magic_check)ÚsÚmatchrrrr Zsr cCs|ddkS)NrÚ.ó.é.)r(r*r)r rrrrasrcCsVtjj|ƒ\}}t|tƒr<tjd|ƒ}ntjd|ƒ}||S)z#Escape all special characters. s[\1]z[\1])rr Ú splitdriverrr#Úsubr%)rZdriverrrÚescapeds r-)Ú__doc__rÚrerÚ__all__rrrrÚcompiler%r#r rr-rrrrÚs     )