³ņ £l‡Jc@spdZddkZddkZdddgZdd„Zhad„Zdd„Zdd „Z dd „Z dS( sµCache lines from 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. i’’’’Ntgetlinet clearcachet checkcachecCsKt||ƒ}d|jot|ƒjno||dSndSdS(Nit(tgetlinestlen(tfilenametlinenotmodule_globalstlines((s/sys/lib/python/linecache.pyR s$cCs hadS(sClear the cache entirely.N(tcache(((s/sys/lib/python/linecache.pyRscCs.|tjot|dSnt||ƒSdS(ssGet the lines for a file from the cache. Update the cache if it doesn't contain an entry for this file already.iN(R t updatecache(RR((s/sys/lib/python/linecache.pyR!s cCsŪ|djotiƒ}n|tjo |g}ndSx™|D]‘}t|\}}}}|djoqBnyti|ƒ}Wn tij ot|=qBnX||ijp||ijo t|=qBqBWdS(sUDiscard cache entries that are out of date. (This is not checked upon each call!)N(tNoneR tkeystoststatterrortst_sizetst_mtime(Rt filenamestsizetmtimeR tfullnameR((s/sys/lib/python/linecache.pyR+s"     cCs|tjo t|=n| p|d|ddjogSn|}yti|ƒ}Wn°tij o”}tii|ƒd}|od|joō|idƒ}|d}t|dd ƒ}|o¾|o·|i |idƒddƒo’y||ƒ} Wnt t fj oq†X| d jogSnt | ƒd g} | i ƒD]} | | d qR~ |ft|it __loader__t__name__t get_sourcet.s itrUN(R RRRtpathtsplittgettgetattrR t startswitht ImportErrortIOErrorRt splitlinestsystjoint TypeErrortAttributeErrortopent readlinestcloseRR(RRRRtmsgtbasenametnametloaderRtdatat_[1]tlinetdirnametfpR RR((s/sys/lib/python/linecache.pyR DsZ  ! !  5     ( t__doc__R$Rt__all__R RR RRRR (((s/sys/lib/python/linecache.pyss