Edit File: __init__.pyo
� ��abc�������� ���@@��s��d��Z��d�d�l�m�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�e�e�d���sp�e�j �e�_ �n��e�e�j�d���s��e�j�j�e�j�_ �n��d�d�d�d �d �d�d�d �d�d�d�d�d�g �Z�d�e�f�d�������YZ�d�e�f�d�������YZ�d�e�f�d�������YZ�d �e�f�d�������YZ�d �e�f�d�������YZ�d�e�f�d�������YZ�d�e�f�d�������YZ�d �e�f�d�������YZ�d�e�f�d�������YZ�d�e�f�d�������YZ�d����Z�d����Z�d ����Z�d!����Z�d�d"���Z �e�e�d#���r�d$�d%�l!�m"�Z#�e#�j$�Z%�n�d$�d&�l!�m&�Z'�e'�j(�Z%�e%�Z)�d�S('���s�� lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = LockFile('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked already.' ... except LockFailed: ... print 'somefile', 'can\'t be locked.' ... else: ... print 'got lock' got lock >>> print lock.is_locked() True >>> lock.release() >>> lock = LockFile('somefile') >>> print lock.is_locked() False >>> with lock: ... print lock.is_locked() True >>> print lock.is_locked() False >>> lock = LockFile('somefile') >>> # It is okay to lock twice from the same thread... >>> with lock: ... lock.acquire() ... >>> # Though no counter is kept, so you can't unlock multiple times... >>> print lock.is_locked() False Exceptions: Error - base class for other exceptions LockError - base class for all locking exceptions AlreadyLocked - Another thread or process already holds the lock LockFailed - Lock failed for some other reason UnlockError - base class for all unlocking exceptions AlreadyUnlocked - File was not locked. NotMyLock - File was locked but not by the current thread/process i����(���t���absolute_importNt���current_threadt���get_namet���Errort ���LockErrort���LockTimeoutt ���AlreadyLockedt ���LockFailedt���UnlockErrort ���NotLockedt ���NotMyLockt���LinkFileLockt ���MkdirFileLockt���SQLiteFileLockt���LockBaset���lockedc�����������B@��s���e��Z�d��Z�RS(���sw��� Base class for other exceptions. >>> try: ... raise Error ... except Exception: ... pass (���t���__name__t ���__module__t���__doc__(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���J���s���c�����������B@��s���e��Z�d��Z�RS(���s���� Base class for error arising from attempts to acquire the lock. >>> try: ... raise LockError ... except Error: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���V���s���c�����������B@��s���e��Z�d��Z�RS(���s����Raised when lock creation fails within a user-defined period of time. >>> try: ... raise LockTimeout ... except LockError: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���b���s���c�����������B@��s���e��Z�d��Z�RS(���s����Some other thread/process is locking the file. >>> try: ... raise AlreadyLocked ... except LockError: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���m���s���c�����������B@��s���e��Z�d��Z�RS(���s����Lock file creation failed for some other reason. >>> try: ... raise LockFailed ... except LockError: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���x���s���c�����������B@��s���e��Z�d��Z�RS(���s���� Base class for errors arising from attempts to release the lock. >>> try: ... raise UnlockError ... except Error: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�������s���c�����������B@��s���e��Z�d��Z�RS(���s����Raised when an attempt is made to unlock an unlocked file. >>> try: ... raise NotLocked ... except UnlockError: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR �������s���c�����������B@��s���e��Z�d��Z�RS(���s����Raised when an attempt is made to unlock a file someone else locked. >>> try: ... raise NotMyLock ... except UnlockError: ... pass (���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR �������s���t���_SharedBasec�����������B@��sA���e��Z�d�����Z�d�d���Z�d����Z�d����Z�d����Z�d����Z�RS(���c���������C@��s ���|�|��_��d��S(���N(���t���path(���t���selfR���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���__init__����s����c���������C@��s���t��d�����d�S(���s��� Acquire the lock. * If timeout is omitted (or None), wait forever trying to lock the file. * If timeout > 0, try to acquire the lock for that many seconds. If the lock period expires and the file is still locked, raise LockTimeout. * If timeout <= 0, raise AlreadyLocked immediately if the file is already locked. s���implement in subclassN(���t���NotImplemented(���R���t���timeout(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���acquire����s����c���������C@��s���t��d�����d�S(���sX��� Release the lock. If the file is not locked, raise NotLocked. s���implement in subclassN(���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���release����s����c���������C@��s���|��j�����|��S(���s*��� Context manager support. (���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt ���__enter__����s���� c���������G@��s���|��j�����d�S(���s*��� Context manager support. N(���R���(���R���t���_exc(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���__exit__����s����c���������C@��s���d�|��j��j�|��j�f�S(���Ns���<%s: %r>(���t ���__class__R���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���__repr__����s����N( ���R���R���R���t���NoneR���R���R���R���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�������s��� c�����������B@��sA���e��Z�d��Z�e�d�d���Z�d����Z�d����Z�d����Z�d����Z �RS(���s.���Base class for platform-specific lock classes.c���������C@��s����t��t�|����j�|���t�j�j�|���d�|��_�t�j����|��_ �t�j ����|��_�|�r��t�j ����}�t�|�d�t�|�����}�d�|�d�@|��_�n �d�|��_�t�j�j�|��j���}�t�j�j�|�d�|��j �|��j�|��j�t�|��j���f���|��_�|�|��_�d�S(���si��� >>> lock = LockBase('somefile') >>> lock = LockBase('somefile', threaded=False) s���.lockt���idents���-%xI��������t����s ���%s%s.%s%sN(���t���superR���R���t���osR���t���abspatht ���lock_filet���sockett���gethostnamet���hostnamet���getpidt���pidt ���threadingR���t���getattrt���hasht���tnamet���dirnamet���joint���unique_nameR���(���R���R���t���threadedR���t���tR!���R0���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�������s ���� c���������C@��s���t��d�����d�S(���s9��� Tell whether or not the file is locked. s���implement in subclassN(���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt ���is_locked����s����c���������C@��s���t��d�����d�S(���sA��� Return True if this object is locking the file. s���implement in subclassN(���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���i_am_locking����s����c���������C@��s���t��d�����d�S(���sN��� Remove a lock. Useful if a locking thread failed to unlock. s���implement in subclassN(���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt ���break_lock��s����c���������C@��s���d�|��j��j�|��j�|��j�f�S(���Ns���<%s: %r -- %r>(���R���R���R2���R���(���R���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�����s����N( ���R���R���R���t���TrueR ���R���R5���R6���R7���R���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�������s���! c���������O@��sm���t��j�d�|�t�d�d��t�|�d�t���s:�|�d�}�n��t�|���d�k�r`�|�r`�t�|�d�<n��|��|�|����S(���Ns1���Import from %s module instead of lockfile packaget ���stackleveli���i����i���R3���(���t���warningst���warnt���DeprecationWarningt ���isinstancet���strt���lenR8���(���t���clst���modt���argst���kwds(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt ���_fl_helper��s���� c����������O@��s&���d�d�l��m�}�t�|�j�d�|��|���S(���s����Factory function provided for backwards compatibility. Do not use in new code. Instead, import LinkLockFile from the lockfile.linklockfile module. i���(���t���linklockfiles���lockfile.linklockfile(���R"���RE���RD���t���LinkLockFile(���RB���RC���RE���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR�����s����c����������O@��s&���d�d�l��m�}�t�|�j�d�|��|���S(���s����Factory function provided for backwards compatibility. Do not use in new code. Instead, import MkdirLockFile from the lockfile.mkdirlockfile module. i���(���t ���mkdirlockfiles���lockfile.mkdirlockfile(���R"���RG���RD���t ���MkdirLockFile(���RB���RC���RG���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���%��s����c����������O@��s&���d�d�l��m�}�t�|�j�d�|��|���S(���s����Factory function provided for backwards compatibility. Do not use in new code. Instead, import SQLiteLockFile from the lockfile.mkdirlockfile module. i���(���t���sqlitelockfiles���lockfile.sqlitelockfile(���R"���RI���RD���t���SQLiteLockFile(���RB���RC���RI���(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR ���0��s����c���������@��s��������f�d����}�|�S(���s��Decorator which enables locks for decorated function. Arguments: - path: path for lockfile. - timeout (optional): Timeout for acquiring lock. Usage: @locked('/var/run/myname', timeout=0) def myname(...): ... c���������@��s(���t��j�������������f�d������}�|�S(���Nc����������@��s?���t����d����}�|�j����z����|��|����SWd��|�j����Xd��S(���NR���(���t���FileLockR���R���(���RB���t���kwargst���lock(���t���funcR���R���(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���wrapperH��s ���� (���t ���functoolst���wraps(���RN���RO���(���R���R���(���RN���sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���decorG��s����$(����(���R���R���RR���(����(���R���R���sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyR���;��s���� t���linki���(���RE���(���RG���(*���R���t ���__future__R����RP���R$���R'���R,���R:���t���hasattrt ���currentThreadR���t���Threadt���getNameR���t���__all__t ���ExceptionR���R���R���R���R���R���R ���R ���t���objectR���R���RD���R���R���R ���R ���R���R"���RE���t���_llfRF���t���LockFileRG���t���_mlfRH���RK���(����(����(����sA���/usr/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.pyt���<module>4���sF��� -: