Viewing File: /usr/lib/python3.6/site-packages/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-36.pyc

3

aj\
@sPddlmZddlZddlZddlmZmZmZmZm	Z	m
Z
GdddeZdS))absolute_importN)LockBase
LockFailed	NotLocked	NotMyLockLockTimeout
AlreadyLockedc@s:eZdZdZd
ddZddZddZd	d
ZddZdS)LinkLockFilezLock access to a file using atomic property of link(2).

    >>> lock = LinkLockFile('somefile')
    >>> lock = LinkLockFile('somefile', threaded=False)
    NcCs"yt|jdjWn"tk
r6td|jYnX|dk	rD|n|j}tj}|dk	rj|dkrj||7}xytj|j|j	Wnt
k
rtj|jj}|dkrdS|dk	rtj|krtj
|j|dkrtd|jntd|jtj|dk	r
|dpdYqlXdSqlWdS)	Nwbzfailed to create %srz&Timeout waiting to acquire lock for %sz%s is already locked
g?)openunique_namecloseIOErrorrtimeouttimeoslink	lock_fileOSErrorstatst_nlinkunlinkrpathr	Zsleep)selfrZend_timeZnlinksr"/usr/lib/python3.6/linklockfile.pyacquires0
$zLinkLockFile.acquirecCsP|jstd|jntjj|js4td|jtj|jtj|jdS)Nz%s is not lockedz%s is locked, but not by me)		is_lockedrrrexistsrrrr)rrrrrelease7szLinkLockFile.releasecCstjj|jS)N)rrr!r)rrrrr ?szLinkLockFile.is_lockedcCs(|jo&tjj|jo&tj|jjdkS)Nr)r rrr!rrr)rrrri_am_lockingBszLinkLockFile.i_am_lockingcCstjj|jrtj|jdS)N)rrr!rr)rrrr
break_lockGszLinkLockFile.break_lock)N)	__name__
__module____qualname____doc__rr"r r#r$rrrrr

s
&r
)Z
__future__rrrrrrrrr	r
rrrr<module>s 
Back to Directory File Manager