usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyc000064400000005535147205631540021631 0ustar00 abc@@spddlmZddlZddlZddlmZmZmZmZm Z m Z defdYZ dS(i(tabsolute_importNi(tLockBaset LockFailedt NotLockedt NotMyLockt LockTimeoutt AlreadyLockedt LinkLockFilecB@s>eZdZddZdZdZdZdZRS(sLock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = LinkLockFile('somefile', threaded=False) cC@s~yt|jdjWn$tk r@td|jnX|dk rS|n|j}tj}|dk r|dkr||7}nxtryyt j |j|j Wnt k rqt j |jj}|dkrdS|dk rKtj|krKt j|j|dkr5td|jqKtd|jntj|dk rg|dpjdqXdSqWdS( Ntwbsfailed to create %siis&Timeout waiting to acquire lock for %ss%s is already lockedi g?(topent unique_nametclosetIOErrorRtNonettimeoutttimetTruetostlinkt lock_filetOSErrortstattst_nlinktunlinkRtpathRtsleep(tselfRtend_timetnlinks((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pytacquires0       'cC@sq|js"td|jn+tjj|jsMtd|jntj|jtj|jdS(Ns%s is not lockeds%s is locked, but not by me( t is_lockedRRRtexistsR RRR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pytrelease7s  cC@stjj|jS(N(RRRR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyR?scC@s:|jo9tjj|jo9tj|jjdkS(Ni(RRRRR RR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyt i_am_lockingBs cC@s,tjj|jr(tj|jndS(N(RRRRR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyt break_lockGsN( t__name__t __module__t__doc__R RR RR!R"(((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyR s  &   ( t __future__RRRtRRRRRRR(((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyts  .