ž ¨ÿf c @ s‹ d Z d d l Z d d l Z d d l Z d d d g Z d d d „ Z i a d d „ Z d d d „ Z d d d „ Z d d d „ Z d S( uµ 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 Nu getlineu clearcacheu checkcachec C sE t | | ƒ } d | k o, t | ƒ k n r= | | d Sd Sd S( Ni u ( u getlinesu len( u filenameu linenou module_globalsu lines( ( u. /opt/alt/python33/lib64/python3.3/linecache.pyu getline s "c C s i a d S( u Clear the cache entirely.N( u cache( ( ( u. /opt/alt/python33/lib64/python3.3/linecache.pyu clearcache s c C s) | t k r t | d St | | ƒ Sd S( us Get the lines for a file from the cache. Update the cache if it doesn't contain an entry for this file already.i N( u cacheu updatecache( u filenameu module_globals( ( u. /opt/alt/python33/lib64/python3.3/linecache.pyu getlines" s u getlinesc C s× | d k r! t t j ƒ ƒ } n | t k r9 | g } n d Sx“ | D]‹ } t | \ } } } } | d k rr qD n y t j | ƒ } Wn t j k r¦ t | =wD Yn X| | j k sÅ | | j k rD t | =qD qD Wd S( uU Discard cache entries that are out of date. (This is not checked upon each call!)N( u Noneu listu cacheu keysu osu statu erroru st_sizeu st_mtime( u filenameu filenamesu sizeu mtimeu linesu fullnameu stat( ( u. /opt/alt/python33/lib64/python3.3/linecache.pyu checkcache, s c &