????

Your IP : 18.116.100.166


Current Path : /lib/python3.6/site-packages/pip/_vendor/lockfile/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/pip/_vendor/lockfile/__pycache__/symlinklockfile.cpython-36.pyc

3

�Pf8
�@sLddlmZddlZddlZddlmZmZmZmZm	Z	Gdd�de�Z
dS)�)�absolute_importN�)�LockBase�	NotLocked�	NotMyLock�LockTimeout�
AlreadyLockedc@sDeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�SymlinkLockFilez'Lock access to a file using symlink(2).TNcCs(tj||||�tjj|j�d|_dS)Nr)r�__init__�os�path�split�unique_name)�selfrZthreaded�timeout�r�%/usr/lib/python3.6/symlinklockfile.pyr

szSymlinkLockFile.__init__cCs�|dk	r|n|j}tj�}|dk	r2|dkr2||7}x�ytj|j|j�Wnttk
r�|j�rddS|dk	r�tj�|kr�|dkr�td|j	��nt
d|j	��tj|dk	r�|dnd�Yq4XdSq4WdS)Nrz&Timeout waiting to acquire lock for %sz%s is already locked�
g�������?)r�timer�symlinkr�	lock_file�OSError�i_am_lockingrrrZsleep)rrZend_timerrr�acquires$
 zSymlinkLockFile.acquirecCs>|j�std|j��n|j�s.td|j��tj|j�dS)Nz%s is not lockedz%s is locked, but not by me)�	is_lockedrrrrr�unlinkr)rrrr�release6s
zSymlinkLockFile.releasecCstjj|j�S)N)rr�islinkr)rrrrr=szSymlinkLockFile.is_lockedcCs tjj|j�otj|j�|jkS)N)rrrr�readlinkr)rrrrr@szSymlinkLockFile.i_am_lockingcCstjj|j�rtj|j�dS)N)rrrrr)rrrr�
break_lockDszSymlinkLockFile.break_lock)TN)N)
�__name__�
__module__�__qualname__�__doc__r
rrrrrrrrrr	
s

#r	)Z
__future__rrr�rrrrrr	rrrr�<module>s