/usr/lib64/python2.6/site-packages/mx/BeeBase
NameSizeModeActions
mxBeeBase/-0755rm
BeeBase.py4860644editdlrm
BeeBase.pyc6360644editdlrm
BeeBase.pyo6360644editdlrm
BeeDict.py515460644editdlrm
BeeDict.pyc494510644editdlrm
BeeDict.pyo490180644editdlrm
BeeIndex.py6270644editdlrm
BeeIndex.pyc7680644editdlrm
BeeIndex.pyo7680644editdlrm
BeeStorage.py360760644editdlrm
BeeStorage.pyc318500644editdlrm
BeeStorage.pyo318500644editdlrm
Cache.py67380644editdlrm
Cache.pyc65150644editdlrm
Cache.pyo65150644editdlrm
COPYRIGHT20490644editdlrm
ExitFunctions.py23080644editdlrm
ExitFunctions.pyc28780644editdlrm
ExitFunctions.pyo28780644editdlrm
FileLock.py124190644editdlrm
FileLock.pyc120940644editdlrm
FileLock.pyo120940644editdlrm
LICENSE45870644editdlrm
README1420644editdlrm
showBeeDict.pyc22890644editdlrm
showBeeDict.pyo22890644editdlrm
__init__.py3940644editdlrm
__init__.pyc5560644editdlrm
__init__.pyo5560644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyo (12094B)
Ñò fÑNc@sýdZddklZddkZddkZddkZddkZdZddd„Z e ƒ\Z Z dei fd „ƒYZ e Zd dd „ƒYZeZd efd „ƒYZeedƒo eZneZd„Zedjo eƒndS(sd FileLock - Implements a file lock mechanism that does not depend on fcntl. Copyright (c) 1997-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2008, eGenix.com Software GmbH; mailto:info@egenix.com See the documentation for further information on copyrights, or contact the author. All Rights Reserved. iÿÿÿÿ(t ExitFunctionsNs1.0t localhosts 127.0.0.1c Cs’yddk}Wntj o|SXyC|djo|iƒ}n|i|ƒ}|i|ƒd}Wn|ij o|SX||fSdS(sÿ Returns fully qualified (hostname, ip) for the given hostname. If hostname is not given, the default name of the local host is chosen. Defaults to default in case an error occurs while trying to determine the data. iÿÿÿÿNi(tsockett ImportErrortNonet gethostnamet gethostbynamet gethostbyaddrterror(thostnametdefaultRtip((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt _fqhostnames  tErrorcBseZRS((t__name__t __module__(((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR /stSymbolicFileLockc Bs³eZdZdZdZd„Zd„Zddeie eie i e e d„Zde ie eie i d„Zd„Zd „Zd „Zd „Ze id „Zd „ZRS(s Implements a file lock mechanism. The base class implements the locking mechanism using symbolic links. Note that since the mechanism does not use file system function calls this may not always work in the desired way. The lock is acquired per process, not per thread. Instancevariables: filename - file the lock applies to lockfilename - name of the lock file locked - indicator if the lock is in position (1) or not (0) icCs3||_|d|_d|_ti|iƒdS(Ns.lockedi(tfilenamet lockfilenametlockedRtregistertunlock(tselfR((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt__init__Ps   cCs=|io|idƒnyti|iƒWnnXdS(Ni(RRRt deregister(R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt__del__Xs  iôg-Cëâ6?c Cs|iodS|i} d|tiƒf} |ƒ|d} tii} ti} ti}x™| | ƒp,y| | | ƒWn|j oq™XPn||ƒ|ƒ| joC|iƒpq`n|i ƒ\}}|d|i ||f‚q`q`d|_dS(s= Try to lock the file for this process, waiting timeout ms if necessary. Raises an exception if a timeout occurs. Multiple locking by the same process is not an error. Note that a non existent path to the file will also result in a timeout. If the lock is held by a process running on our host, a timeout will first invoke a check of the locking process. If it is not alive anymore, the lock is removed and granted to the current process. Ns%s:%igü©ñÒMbP?s$file "%s" is locked by process %s:%ii( RRtostgetpidtpathtislinktsymlinktreadlinkt validate_lockt lock_infoR(Rttimeoutt sleeptimetsleepR ttimeRR R RtlockinfotstopRtmakelinkRthostt locking_pid((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pytlockas0        cCsh|ipdSd|_y||iƒWn#|j o|d|i‚nX|o||ƒndS(s Release the lock, letting other processes using this mechanism access the file. Multiple unlocking is not an error. Raises an exception if the lock file was already deleted by another process. After having unlocked the file the process sleeps for sleeptime seconds to give other processes a chance to acquire the lock too. If the lock will only be used every once in a while by the process, it is safe to set it to 0. Nisfile lock "%s" is already gonei(RR(RR#tunlinkR R$R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR“s  cCs.|iodStii|iƒodSdS(sÕ Returns the current state of the file lock: 1 - a lock exists, 0 - no lock exists. Note that in case a lock exists, this lock is not checked for being valid. ii(RRRRR(R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pythas_lock°s cCsoy(titi|iƒdƒ\}}Wn.tij o}td|i|f‚nXt|ƒ}||fS(s° Returns a tuple (hostname, PID integer) indicating the host and process id currently holding the lock. An Error is raised if no lock exists. t:s!file "%s" could not be locked: %s( tstringtsplitRRRRR Rtint(RR)R*twhy((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR!¿s( c Cs&|iob|iƒ}|tiƒ|ijo8yti|iƒWntij o }dSXdSqln|iƒ\}}|tjo&t |ddƒd}t |j}nd}|odyti |dƒWq"tij o:}yti|iƒWntij oqXdSq"XndS(sL Validates a lock on the file and return 1 for a valid lock, 0 for an invalid one. Note that it is only possible to check for valid locks which are owned by the same host. This method removes any invalid locks it may find. An Error is raised if no lock exists. iiR s???(s???s???( t locktimeoutt lock_timeR%RR,RRR!R R R tkill(RtctimeR2R)R*tother_iptsamehost((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR Ðs.     cCsOyti|iƒd}Wn.tij o}td|i|f‚nX|S(sš Returns a Unix time value indicating the time when the current lock was created. An Error is raised if no lock exists. i s*could not read file lock info for "%s": %s(RtlstatRRR R(RR6R2((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR4scCs(d|_y||iƒWnnXdS(s/ Remove any existing lock on the file. iN(RR(RR,((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt remove_locks  cCs d|ii|it|ƒfS(Ns<%s for "%s" at %x>(t __class__RRtid(R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt__repr__s (RRt__doc__RR3RRR%R$R RRR R R+R,RR-R!R R4R:R=(((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR7s   /   1  tDirectyFileLockc Bs’eZdZddeieeieiee ei d„ Z dei eeieid„Z d„Zd„Zd„Zd„Zei d „ZRS( sØ This class implements a file lock mechanism that uses temporary directories for locking. See FileLock for documentation of the various methods. Thanks to Thomas Heller for this idea ! iôg-Cëâ6?c Cs¹|iodS|i} d|tiƒf} |ƒ|d} xjy| | ƒWn|j onXP||ƒ|ƒ| jo(|iƒpqBn|d|i‚qBqBd|_dS(Ns%s:%igü©ñÒMbP?sfile "%s" is currently lockedi(RRRRR R( RR"R#R$R R%RR R tmkdirRR&R'((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR+3s$    cCsh|ipdSd|_y||iƒWn#|j o|d|i‚nX|o||ƒndS(Nisfile lock "%s" is already gonei(RR(RR#trmdirR R$R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyROs  cCs.|iodStii|iƒodSdS(Nii(RRRtisdirR(R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR-`s  cCsp|iob|iƒ}|tiƒ|ijo8yti|iƒWntij o }dSXdSqlndS(Nii(R3R4R%RRARR(RR6R2((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR hs   cCs td‚dS(s€ Locking info is not available for DirectyFileLocks. A TypeError is raised in case this method is called. s4.lock_info() is not implemented for DirectyFileLocksN(t TypeError(R((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR!yscCsOyti|iƒd}Wn.tij o}td|i|f‚nX|S(Ni s*could not read file lock info for "%s": %s(RtstatRRR R(RR6R2((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR4ƒscCs(d|_y||iƒWnnXdS(Ni(RR(RRA((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR:s  (RRR>R%R$R RRR R R@R+RARR-R R!R4R:(((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyR?(s    Rc Csªtdƒ}tiƒ}yHxAtdƒD]3}d|G|iƒti|dƒ|iƒq(WWntj o|iƒnXtiƒ|}d||||fGHdS(Ns test-locki's%i gjø@s5%i lock/release cycles in %5.2f sec. = %i cycles/sec.(tFileLockR%trangeR+R$RtKeyboardInterrupt(R+t starttimetit totaltime((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt_testžs    t__main__(Rs 127.0.0.1((R>tmx.Misc.ExitFunctionsRRt exceptionsR%R/t __version__RR R R t StandardErrorR t FileLockErrorRt BaseFileLockR?thasattrRERKR(((s9/usr/lib64/python2.6/site-packages/mx/BeeBase/FileLock.pyt s 0íq