3
\ ã @ sº d Z ddlZddlZddlZdddgZddœdd„Zddœd d„Zd
d„ Zdd
„ Zdd„ Z dd„ Z
dd„ Zdd„ Zdd„ Z
dd„ ZejdƒZejdƒZdd„ Zdd„ Zd d!„ Zd"d„ ZdS )#zFilename globbing utility.é NÚglobÚiglobÚescapeF)Ú recursivec 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.
)r )Úlistr )Úpathnamer © r ú/usr/lib64/python3.6/glob.pyr s c C s$ 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)r r ÚitÚsr r r r s c c s t jj| ƒ\}}t| ƒsF|r0t jj| ƒrB| V nt jj|ƒrB| V d S |s€|rjt|ƒrjt|||ƒE d H nt|||ƒE d H d S || kržt|ƒržt ||dƒ}n|g}t|ƒrÄ|r¾t|ƒr¾t}qÈt}nt
}x2|D ]*}x$||||ƒD ]}t jj||ƒV qàW qÎW d S )NT)ÚosÚpathÚsplitÚ has_magicÚlexistsÚisdirr Ú_glob2Ú_glob1r
Ú_glob0Újoin)r r ÚdironlyÚdirnameÚbasenameÚdirsZglob_in_dirÚnamer r r r
' s0
r
c C s0 t t| |ƒƒ}t|ƒs$dd„ |D ƒ}tj||ƒS )Nc s s | ]}t |ƒs|V qd S )N)Ú _ishidden)Ú.0Úxr r r ú