ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python34/lib64/python3.4/__pycache__/linecache.cpython-34.pyc

�
e fq�@s�dZddlZddlZddlZdddgZddd�Ziadd�Zddd	�Zdd
d�Z	ddd�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�
checkcachecCsEt||�}d|ko,t|�knr=||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�./opt/alt/python34/lib64/python3.4/linecache.pyrs"cCs
iadS)zClear the cache entirely.N)�cacher
r
r
rrscCsM|tkrt|dSyt||�SWntk
rHt�gSYnXdS)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.�N)r�updatecache�MemoryErrorr)r	rr
r
rr"s
rcCs�|dkr!ttj��}n|tkr9|g}ndSx�|D]�}t|\}}}}|dkrrqDnytj|�}Wntk
r�t|=wDYnX||jks�||jkrDt|=qDqDWdS)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)N)�listr�keys�os�stat�OSError�st_size�st_mtime)r	�	filenames�size�mtimer�fullnamerr
r
rr0s 

c"Cs_|tkrt|=n|s;|jd�r?|jd�r?gS|}ytj|�}Wnktk
r�|}|r3d|kr3|jd�}|d}t|dd�}|r3|r3y||�}Wnttfk
r�Yq0X|dkr�gSt	|�ddd�|j
�D�|ft|<t|d	Sq3ntjj|�rIgSxut
jD]f}	ytjj|	|�}Wnttfk
r�wSYnXytj|�}PWqStk
r�YqSXqSWgSYnXy(tj|��}
|
j�}WdQXWntk
rgSYnX|r2|djd�r2|d
d7<n|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.�<�>�
__loader__�__name__�
get_sourceNcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>ks	zupdatecache.<locals>.<listcomp>rrr#���r')r�
startswith�endswithrrr�get�getattr�ImportErrorr�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�name�loaderr"�data�dirname�fprrrr
r
rrIs\
%

#
		
	r)�__doc__r0rr4�__all__rrrrrrr
r
r
r�<module>s


Zerion Mini Shell 1.0