Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/
Upload File :
Current File : //usr/lib/python2.7/linecache.pyc


|_c@spdZddlZddlZdddgZddZiadZddZdd	Z	dd
Z
dS(sCache 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.
iNtgetlinet
clearcachet
checkcachecCsEt||}d|ko,t|knr=||dSdSdS(Nit(tgetlinestlen(tfilenametlinenotmodule_globalstlines((s/usr/lib/python2.7/linecache.pyR
s"cCs
iadS(sClear the cache entirely.N(tcache(((s/usr/lib/python2.7/linecache.pyRscCs)|tkrt|dSt||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
tupdatecache(RR((s/usr/lib/python2.7/linecache.pyR!scCs|dkrtj}n|tkr3|g}ndSx|D]}t|\}}}}|dkrlq>nytj|}Wntjk
rt|=q>nX||jks||jkr>t|=q>q>WdS(sUDiscard cache entries that are out of date.
    (This is not checked upon each call!)N(tNoneR
tkeystoststatterrortst_sizetst_mtime(Rt	filenamestsizetmtimeR	tfullnameR((s/usr/lib/python2.7/linecache.pyR+s 
cCs{|tkrt|=n|s;|jdr?|jdr?gS|}ytj|}Wntk
r|}|r<d|kr<|jd}|d}t|dd
}|r<|r<y||}Wnt	t
fk
rq9X|d
krgSt|d
g|jD]}	|	d^q
|ft|<t|dSq<ntj
j|rRgS|dkrg|}nxztj
D]g}
ytj
j|
|}Wnttfk
rqqnXytj|}PWqqtjk
rqqXqqWgSnXy(t|d	}|j}Wd
QXWnt
k
r gSX|rN|djdrN|dcd7<n|j|j}
}|
|||ft|<|S(sUpdate a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.t<t>t
__loader__t__name__t
get_sources
is__init__.pytrUNi(R
t
startswithtendswithRRtOSErrortgettgetattrRtImportErrortIOErrorRt
splitlinestpathtisabstsystjoint	TypeErrortAttributeErrorRtopent	readlinesRR(RRRRtbasenametnametloaderRtdatatlinetdirnametfpR	RR((s/usr/lib/python2.7/linecache.pyRDs`
%

-	
(t__doc__R'Rt__all__RRR
RRRR(((s/usr/lib/python2.7/linecache.pyt<module>s