eaiovnaovbqoebvqoeavibavo B  f@sndZddlZddlZddlZddlZdddgZdddZiaddZddd Z dd dZ dd d Z d dZ dS)zCache lines from Python source files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. Ngetline clearcache checkcachecCs:t||}d|kr"t|kr2nn ||dSdSdS)N)getlineslen)filenamelinenomodule_globalslinesr ./opt/alt/python37/lib64/python3.7/linecache.pyrs  cCsiadS)zClear the cache entirely.N)cacher r r rrscCsR|tkr(t|}t|dkr(t|dSy t||Stk rLtgSXdS)zGet the lines for a Python source file from the cache. Update the cache if it doesn't contain an entry for this file already.rN)rr updatecache MemoryErrorr)r r entryr r rr%s   rc Cs|dkrtt}n|tkr&|g}ndSx|D]}t|}t|dkrJq0|\}}}}|dkr`q0yt|}Wn"tk rt|dw0YnX||jks||j kr0t|dq0WdS)zUDiscard cache entries that are out of date. (This is not checked upon each call!)Nr) listrkeysrosstatOSErrorpopst_sizest_mtime)r filenamesrsizemtimer fullnamerr r rr5s&    c Cs|tkr$tt|dkr$t|d|r<|dr@|dr@gS|}yt|}Wntk rZ|}t||ryt|d}Wnt tfk rYnrcSsg|] }|dqS) r ).0liner r r qszupdatecache..rr")rrr startswithendswithrrr lazycache ImportError splitlinespathisabssysjoin TypeErrorAttributeErrortokenizeopen readlinesrr) r r rrbasenamedatadirnamefpr rrr r rrRsV         rcCs|tkr tt|dkrdSdS|r8|dr<|drr.rr2__all__rrrrrrr)r r r rs     A