grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B ÅFiÖ' Úã@sndZddlZddlZddlZddlZdddgZddd„Ziadd„Zddd „Z dd d„Z dd d „Z d d„Z dS)zÃCache 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. éNÚgetlineÚ clearcacheÚ checkcachecCs:t||ƒ}d|kr"t|ƒkr2nn ||dSdSdS)NéÚ)ÚgetlinesÚlen)ÚfilenameÚlinenoÚmodule_globalsÚlines©r ú./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 rLtƒgSXdS)z�Get the lines for a Python source file from the cache. Update the cache if it doesn't contain an entry for this file already.réN)rrÚ updatecacheÚ MemoryErrorr)r r Úentryr r rr%s   rc Csº|dkrtt ¡ƒ}n|tkr&|g}ndSxŠ|D]‚}t|}t|ƒdkrJq0|\}}}}|dkr`q0yt |¡}Wn"tk r�t |d¡w0YnX||jks¦||j kr0t |d¡q0WdS)zUDiscard cache entries that are out of date. (This is not checked upon each call!)Nr) ÚlistrÚkeysrÚosÚstatÚOSErrorÚpopÚst_sizeÚst_mtime)r Ú filenamesrÚsizeÚmtimer Úfullnamerr r rr5s&    c CsÞ|tkr$tt|ƒdkr$t |d¡|r<| d¡r@| d¡r@gS|}yt |¡}W�ntk �rZ|}t||ƒrÚyt|dƒ}Wnt tfk ržYnrcSsg|] }|d‘qS)Ú r )Ú.0Úliner r rú qszupdatecache..réÿÿÿÿr")rrrÚ startswithÚendswithrrrÚ lazycacheÚ ImportErrorÚ splitlinesÚpathÚisabsÚsysÚjoinÚ TypeErrorÚAttributeErrorÚtokenizeÚopenÚ readlinesrr) r r rrÚbasenameÚdataÚdirnameÚfpr rrr r rrRsV         rcCsŒ|tkr tt|ƒdkrdSdS|r8| d¡r<| d¡rr.rr2Ú__all__rrrrrrr)r r r rÚs     A