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*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ÚAssertionError)r r ÚitÚsr r r r s
c c s
t jj| ƒ\}}t| ƒsP| s"t‚|r:t jj| ƒrL| V nt jj|ƒrL| V d S |sŠ|rtt|ƒrtt|||ƒ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_magicr
ÚlexistsÚisdirr Ú_glob2Ú_glob1r
Ú_glob0Újoin)r r ÚdironlyÚdirnameÚbasenameÚdirsZglob_in_dirÚnamer r r r
' s2
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 ú