Viewing File: /opt/alt/python35/lib64/python3.5/__pycache__/glob.cpython-35.opt-1.pyc



Yf@sdZddlZddlZddlZdddgZddddZddd	dZd
dZdd
ZddZ	ddZ
ddZejdZ
ejdZddZddZddZddZdS)zFilename globbing utility.Nglobiglobescape	recursiveFcCstt|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)pathnamerr)/opt/alt/python35/lib64/python3.5/glob.pyr	scCs1t||}|r-t|r-t|}|S)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.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )_iglob_isrecursivenext)rritsrrr	rsccsNtjj|\}}t|s_|rDtjj|r[|Vntjj|r[|VdS|s|rt|rt||EdHnt||EdHdS||krt|rt	||}n	|g}t|r|rt|rt}qt}nt
}x<|D]4}x+|||D]}tjj||Vq(WqWdS)N)ospathsplit	has_magiclexistsisdirrglob2glob1r
glob0join)rrdirnamebasenamedirsZglob_in_dirnamerrr	r
's0			
r
cCs|s3t|tr*ttjd}n	tj}ytj|}Wntk
r^gSYnXt|s~dd|D}tj||S)NASCIIcSs"g|]}t|s|qSr)	_ishidden).0xrrr	
<listcomp>Ys	zglob1.<locals>.<listcomp>)	
isinstancebytesrcurdirlistdirOSErrorrfnmatchfilter)rpatternnamesrrr	rNs	
	rcCsN|s"tjj|rJ|gSn(tjjtjj||rJ|gSgS)N)rrrrr)rrrrr	r\s
!rccs"|ddVt|EdHdS)Nr)	_rlistdir)rr)rrr	rjsrc
cs|s3t|tr*ttjd}n	tj}ytj|}Wntjk
radSYnXxk|D]c}t|si|V|rtjj||n|}x(t	|D]}tjj||VqWqiWdS)Nr)
r"r#rr$r%errorrrrr+)rr*r ryrrr	r+ps		
!r+z([*?[])s([*?[])cCs:t|tr!tj|}ntj|}|dk	S)N)r"r#magic_check_bytessearchmagic_check)rmatchrrr	rsrcCs|ddkS)Nr...)r2r4r)rrrr	rsrcCs't|tr|dkS|dkSdS)Ns**z**)r"r#)r)rrr	rs
rcCsVtjj|\}}t|tr<tjd|}ntjd|}||S)z#Escape all special characters.
    s[\1]z[\1])rr
splitdriver"r#r.subr0)rZdriverrr	rs
)__doc__rrer'__all__rrr
rrrr+compiler0r.rrrrrrrr	<module>s"
'
Back to Directory File Manager