ó þ¾v]c@s»dZddlZddlZddlZdddgZed„Zed„Zd„Zd „Z d „Z d „Z d „Z ej d ƒZej d ƒZd„Zd„Zd„ZdS(s¡ Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. iÿÿÿÿNtglobtiglobtescapecCstt|d|ƒƒS(syReturn 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. t recursive(tlistR(tpathnameR((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyRs cCsAt||ƒ}|r=t|ƒr=t|ƒ}| s=t‚n|S(sŒ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. (t_iglobt _isrecursivetnexttAssertionError(RRtitts((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyRs  ccsntjj|ƒ\}}t|ƒse|rGtjj|ƒra|Vqantjj|ƒra|VndS|sÂ|rŸt|ƒrŸx>t||ƒD] }|VqWnxt||ƒD] }|Vq¯WdS||krìt|ƒrìt ||ƒ}n |g}t|ƒr%|rt|ƒrt}q+t}nt }x<|D]4}x+|||ƒD]}tjj ||ƒVqHWq2WdS(N( tostpathtsplitt has_magictlexiststisdirRtglob2tglob1Rtglob0tjoin(RRtdirnametbasenametxtdirst glob_in_dirtname((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyR0s4         cCsn|s6t|tƒr*tjjdƒ}q6tj}nytj|ƒ}Wntk r]gSXtj||ƒS(NtASCII( t isinstancetbytesR tcurdirtencodetlistdirtOSErrortfnmatchtfilter(Rtpatterntnames((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyR[s  cCsN|s"tjj|ƒrJ|gSn(tjjtjj||ƒƒrJ|gSgS(N(R R RRR(RR((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyRhs  !ccs;t|ƒst‚|d Vxt|ƒD] }|Vq(WdS(Ni(RR t _rlistdir(RR%R((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyRxs ccsÇ|s6t|tƒr*tjjdƒ}q6tj}nytj|ƒ}Wntjk r`dSXx_|D]W}|V|rŽtjj||ƒn|}x(t |ƒD]}tjj||ƒVq¡WqhWdS(NR( RRR RR R!terrorR RR'(RR&RR ty((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyR'€s  !s([*?[])cCs:t|tƒr!tj|ƒ}ntj|ƒ}|dk S(N(RRtmagic_check_bytestsearcht magic_checktNone(R tmatch((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyR•scCs't|tƒr|dkS|dkSdS(Ns**(RR(R%((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyRs cCsVtjj|ƒ\}}t|tƒr<tjd|ƒ}ntjd|ƒ}||S(s#Escape all special characters. s[\1](R R t splitdriveRRR*tsubR,(Rtdrive((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyR¤s (t__doc__R treR#t__all__tFalseRRRRRRR'tcompileR,R*RRR(((s5/tmp/pip-install-vZZv26/setuptools/setuptools/glob.pyts       +