Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / fasteners / process_lock.pyc
Size: Mime:
ó
ìEYc@sõddlZddlZddlZddlZddlZddlZddlmZeje	ƒZ
d„Zdefd„ƒYZ
de
fd„ƒYZde
fd	„ƒYZejd
krÖddlZeZnddlZeZd„ZdS(iÿÿÿÿN(t_utilscCsyytj|ƒWn]tk
rp}|jtjkrTtjj|ƒsM‚qmtSqu|jtjkrjtS‚nXt	SdS(sfCreate a directory (and any ancestor directories required).

    :param path: Directory to create
    N(
tostmakedirstOSErrorterrnotEEXISTtpathtisdirtFalsetEISDIRtTrue(Rte((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt_ensure_treest_InterProcessLockcBs’eZdZdZdZejdd„Zd„Z	d„Z
eeedd„Zd„Z
d„Zd	„Zd
„Zd„Zd„Zd
„ZRS(sTAn interprocess locking implementation.

    This is a lock implementation which allows multiple locks, working around
    issues like http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632857 and
    does not require any cleanup. Since the lock is always held on a file
    descriptor rather than outside of the process, the lock gets dropped
    automatically if the process crashes, even if ``__exit__`` is not
    executed.

    There are no guarantees regarding usage by multiple threads in a
    single process here. This lock works only between processes.

    Note these locks are released when the descriptor is closed, so it's not
    safe to close the file descriptor while another thread holds the
    lock. Just opening and closing the lock file can break synchronization,
    so lock files must be accessed only using this abstraction.
    gš™™™™™¹?g{®Gáz„?cCs=d|_||_t|_||_tj|tƒ|_	dS(N(
tNonetlockfileRRtacquiredt
sleep_funcRtpick_first_not_nonetLOGtlogger(tselfRRR((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt__init__Us
				cCs‘y|jƒWnxtk
rˆ}|jtjtjfkra|sN|jƒrRtStjƒ‚qt	j
di|jd6|d6ƒ‚nXtSdS(Ns9Unable to acquire lock on `%(path)s` due to %(exception)sRt	exception(
ttrylocktIOErrorRtEACCEStEAGAINtexpiredRRt
RetryAgaint	threadingtThreadErrorRR
(RtblockingtwatchR((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt_try_acquire\s	
cCsƒtjj|jƒ}|rLt|ƒ}|rL|jjtjd|ƒqLn|jdksg|jj
rt|jdƒ|_ndS(NsCreated lock base path `%s`ta(RRtdirnameRRtlogRtBLATHERRRtclosedtopen(Rtbasedirtmade_basedir((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt_do_openpsc	Cs|dkrtdƒ‚n|dk	rB|dkrBtdƒ‚n||krW|}n|jƒtjd|ƒ}tj||d|jd|ƒ}|||j||ƒ}WdQX|sÉt|_	tSt
|_	|jjtj
d|j|jƒ|jƒt
SdS(	söAttempt to acquire the given lock.

        :param blocking: whether to wait forever to try to acquire the lock
        :type blocking: bool
        :param delay: when blocking this is the delay time in seconds that
                      will be added after each failed acquisition
        :type delay: int/float
        :param max_delay: the maximum delay to have (this limits the
                          accumulated delay(s) added after each failed
                          acquisition)
        :type max_delay: int/float
        :param timeout: an optional timeout (limits how long blocking
                        will occur for)
        :type timeout: int/float
        :returns: whether or not the acquisition succeeded
        :rtype: bool
        is+Delay must be greater than or equal to zeros-Timeout must be greater than or equal to zerotdurationRR!NsHAcquired file lock `%s` after waiting %0.3fs [%s attempts were required](t
ValueErrorRR+Rt	StopWatchtRetryRR"RRR
RR%R&Rtelapsedtattempts(RR tdelayt	max_delayttimeoutR!trtgotten((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pytacquire}s*	
		cCs,|jdk	r(|jjƒd|_ndS(N(RRtclose(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt	_do_close¨s
cCs|jƒ|S(N(R7(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt	__enter__­s
cCs´|jstjdƒ‚ny|jƒWn'tk
rR|jjd|jƒn^Xt|_y|j	ƒWn'tk
r“|jjd|jƒnX|jj
tjd|jƒdS(s%Release the previously acquired lock.s$Unable to release an unacquired locks1Could not unlock the acquired lock opened on `%s`s.Could not close the file handle opened on `%s`s*Unlocked and closed file lock open on `%s`N(
RRRtunlockRRRRRR9R%RR&(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pytrelease±s 	
	
cCs|jƒdS(N(R<(Rtexc_typetexc_valtexc_tb((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt__exit__ÇscCstjj|jƒS(s<Checks if the path that this lock exists at actually exists.(RRtexists(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRAÊscCs
tƒ‚dS(N(tNotImplementedError(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRÎscCs
tƒ‚dS(N(RB(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyR;ÑsN(t__name__t
__module__t__doc__t	MAX_DELAYtDELAY_INCREMENTttimetsleepRRR"R+R
R7R9R:R<R@RARR;(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyR
4s 		
)						t_WindowsLockcBs eZdZd„Zd„ZRS(s?Interprocess lock implementation that works on windows systems.cCs#tj|jjƒtjdƒdS(Ni(tmsvcrttlockingRtfilenotLK_NBLCK(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRØscCs#tj|jjƒtjdƒdS(Ni(RKRLRRMtLK_UNLCK(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyR;Ûs(RCRDRERR;(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRJÕs	t
_FcntlLockcBs eZdZd„Zd„ZRS(s=Interprocess lock implementation that works on posix systems.cCs!tj|jtjtjBƒdS(N(tfcntltlockfRtLOCK_EXtLOCK_NB(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRâscCstj|jtjƒdS(N(RQRRRtLOCK_UN(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyR;ås(RCRDRERR;(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyRPßs	tntcst|ƒ‰‡fd†}|S(sSAcquires & releases a interprocess lock around call into
       decorated function.cs%tjˆƒ‡‡fd†ƒ}|S(Ncsˆˆ||ŽSWdQXdS(N((targstkwargs(tftlock(sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pytwrapperùs(tsixtwraps(RYR[(RZ(RYsK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt	decorator÷s!(tInterProcessLock(RR^((RZsK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pytinterprocess_lockedñs	(RtloggingRRRHR\t	fastenersRt	getLoggerRCRRtobjectR
RJRPtnameRKR_RQR`(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/fasteners/process_lock.pyt<module>s"	¡