U e5dA@sddlZddlZddlZddlZdddgZddddZddddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZedZedZddZddZdd Zd!dZdS)"NglobiglobescapeF recursivecCstt||dS)Nr)listr)pathnamerr /usr/lib64/python3.8/glob.pyr s cCs2td||t||d}|r.t|r.t|}|S)Nz glob.globF)sysaudit_iglob _isrecursivenext)rritsr r r rs   ccstj|\}}t|sF|r0tj|rB|Vntj|rB|VdS|s|rjt|rjt|||EdHnt|||EdHdS||krt|rt ||d}n|g}t|r|rt|rt}qt}nt }|D]&}||||D]}tj ||VqqdS)NT) ospathsplit has_magiclexistsisdirr_glob2_glob1r _glob0join)rrdironlydirnamebasenamedirsZ glob_in_dirnamer r r r )s0    r cCs0tt||}t|s$dd|D}t||S)Ncss|]}t|s|VqdSN) _ishidden).0xr r r Tsz_glob1..)r_iterdirr"fnmatchfilter)rpatternrnamesr r r rQsrcCs8|stj|r4|gSntjtj||r4|gSgSr!)rrrrr)rrrr r r rWs  rcCs t||dSNF)rrr)r r r glob0dsr-cCs t||dSr+)rr,r r r glob1gsr.ccs"|ddVt||EdHdS)Nr) _rlistdir)rr)rr r r rmsrc cs|s"t|trttjd}ntj}zRt|>}|D]2}z|rF|rN|jVWq4tk rdYq4Xq4W5QRXWntk rYdSXdS)NASCII) isinstancebytesrcurdirscandiris_dirr OSError)rrrentryr r r r&ts    r&ccs`tt||}|D]H}t|s|V|r6tj||n|}t||D]}tj||VqDqdSr!)rr&r"rrrr/)rrr*r$ryr r r r/sr/z([*?[])s([*?[])cCs(t|trt|}n t|}|dk Sr!)r1r2magic_check_bytessearch magic_check)rmatchr r r rs   rcCs |ddkS)Nr)..r )rr r r r"sr"cCst|tr|dkS|dkSdS)Ns**z**)r1r2)r)r r r rs rcCs<tj|\}}t|tr(td|}n td|}||S)Ns[\1]z[\1])rr splitdriver1r2r9subr;)rZdriver r r rs   )rrer'r __all__rrr rrr-r.rr&r/compiler;r9rr"rrr r r r s(  (