ó •abc@@spddlmZddlZddlZddlmZmZmZmZm Z m Z defd„ƒYZ dS(i(tabsolute_importNi(tLockBaset LockFailedt NotLockedt NotMyLockt LockTimeoutt AlreadyLockedt LinkLockFilecB@s>eZdZdd„Zd„Zd„Zd„Zd„ZRS(sLock access to a file using atomic property of link(2). >>> lock = LinkLockFile('somefile') >>> lock = LinkLockFile('somefile', threaded=False) cC@s~yt|jdƒjƒWn$tk r@td|jƒ‚nX|dk rS|n|j}tjƒ}|dk r|dkr||7}nxêtryyt j |j|j ƒWn¿t k rqt j |jƒj}|dkrådS|dk rKtjƒ|krKt j|jƒ|dkr5td|jƒ‚qKtd|jƒ‚ntj|dk rg|dpjdƒqXdSqWdS( 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|jƒs"td|jƒ‚n+tjj|jƒsMtd|jƒ‚ntj|jƒtj|jƒdS(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|jƒS(N(RRRR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyR?scC@s:|jƒo9tjj|jƒo9tj|jƒjdkS(Ni(RRRRR RR(R((sE/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/linklockfile.pyt i_am_lockingBs cC@s,tjj|jƒr(tj|jƒndS(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  .