Files
old-nlp/venv/lib/python3.7/__pycache__/linecache.cpython-37.pyc

62 lines
3.7 KiB
Plaintext
Raw Normal View History

2019-10-20 13:16:49 +02:00
B
<00>x-]<5D><00>@sndZddlZddlZddlZddlZdddgZddd<03>Ziadd<04>Zddd <09>Z dd
d<05>Z
dd d <0C>Z d d<0E>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.
<EFBFBD>N<>getline<6E>
clearcache<EFBFBD>
checkcachecCs:t||<02>}d|kr"t|<03>kr2nn ||dSdSdS)N<><00>)<02>getlines<65>len)<04>filename<6D>lineno<6E>module_globals<6C>lines<65>r <00>A/home/hamo/projects/misc/adreader/venv/lib/python3.7/linecache.pyrs
 cCsiadS)zClear the cache entirely.N)<01>cacher r r rrscCsR|tkr(t|}t|<02>dkr(t|dSy
t||<01>Stk
rLt<04>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<00>N)rr<00> updatecache<68> MemoryErrorr)r r <00>entryr r rr%s  
rc Cs<>|dkrtt<01><02><00>}n|tkr&|g}ndSx~|D]v}t|}t|<02>dkrJq0|\}}}}|dkr`q0yt<04>|<06>}Wntk
r<EFBFBD>t|=w0YnX||jks<>||jkr0t|=q0WdS)zUDiscard cache entries that are out of date.
(This is not checked upon each call!)Nr) <09>listr<00>keysr<00>os<6F>stat<61>OSError<6F>st_size<7A>st_mtime)r <00> filenamesr<00>size<7A>mtimer <00>fullnamerr r rr5s&
  c Cs<>|tkrtt|<00>dkrt|=|r6|<00>d<02>r:|<00>d<03>r:gS|}yt<04>|<02>}W<00>ntk
<EFBFBD>rT|}t||<01>r<>yt|d<00>}Wnttfk
r<EFBFBD>Yn<X|dkr<>gSt|<05>ddd<07>|<05> <09>D<00>|ft|<t|dStj
<EFBFBD> |<00>r<>gSxjt j
D]\}ytj
<EFBFBD> ||<04>}Wnttfk
<EFBFBD>rw<>YnXyt<04>|<02>}PWq<>tk
<EFBFBD>rFYq<>Xq<>WgSYnXy"t<10>|<02><01>}|<07><12>}WdQRXWntk
<EFBFBD>r<>gSX|<08>r<>|d <00>d
<EFBFBD><01>s<>|d d
7<|j|j} }
| |
||ft|<|S) z<>Update 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.r<00><<3C>>rNcSsg|] }|d<00>qS)<01>
r )<02>.0<EFBFBD>liner r r<00>
<listcomp>qszupdatecache.<locals>.<listcomp>r<00><><EFBFBD><EFBFBD><EFBFBD>r!)rr<00>
startswith<EFBFBD>endswithrrr<00> lazycache<68> ImportError<6F>
splitlines<EFBFBD>path<74>isabs<62>sys<79>join<69> TypeError<6F>AttributeError<6F>tokenize<7A>open<65> readlinesrr) r r rr<00>basename<6D>data<74>dirname<6D>fpr rrr r rrRsV
   


 rcCs<>|tkr tt|<00>dkrdSdS|r8|<00>d<04>r<|<00>d<05>r<dS|r<>d|kr<>|<01>d<07>}|d}t|dd <09>}|r<>|r<>t<06>||<02>}|ft|<dSdS)
a<EFBFBD>Seed the cache for filename with module_globals.
The module loader will be asked for the source only when getlines is
called, not immediately.
If there is an entry in the cache already, it is not altered.
:return: True if a lazy load is registered in the cache,
otherwise False. To register such a load a module loader with a
get_source method must be found, the filename must be a cachable
filename, and the filename must not be already cached.
rTFrr <00>
__loader__<EFBFBD>__name__<5F>
get_sourceN)rrr&r'<00>get<65>getattr<74> functools<6C>partial)r r <00>name<6D>loaderr:Z get_linesr r rr(<00>s  
  
r()N)N)N)N) <0A>__doc__r=r-rr1<00>__all__rrrrrrr(r r r r<00><module>s




A