/usr/lib64/python2.6/site-packages/mx/Misc
NameSizeModeActions
Cache.py67380644editdlrm
Cache.pyc64820644editdlrm
Cache.pyo64820644editdlrm
CommandLine.py187060644editdlrm
CommandLine.pyc183610644editdlrm
CommandLine.pyo183610644editdlrm
ConfigFile.py295410644editdlrm
ConfigFile.pyc330040644editdlrm
ConfigFile.pyo330040644editdlrm
Cookie.py56250644editdlrm
Cookie.pyc57070644editdlrm
Cookie.pyo57070644editdlrm
COPYRIGHT10300644editdlrm
CSV.py185200644editdlrm
CSV.pyc181440644editdlrm
CSV.pyo181440644editdlrm
ExitFunctions.py23080644editdlrm
ExitFunctions.pyc28600644editdlrm
ExitFunctions.pyo28600644editdlrm
FileLock.py124190644editdlrm
FileLock.pyc120250644editdlrm
FileLock.pyo120250644editdlrm
LazyModule.py44000644editdlrm
LazyModule.pyc42440644editdlrm
LazyModule.pyo42440644editdlrm
LICENSE45870644editdlrm
Namespace.py154550644editdlrm
Namespace.pyc180510644editdlrm
Namespace.pyo180510644editdlrm
OrderedMapping.py131070644editdlrm
OrderedMapping.pyc150530644editdlrm
OrderedMapping.pyo150530644editdlrm
PackageTools.py116810644editdlrm
PackageTools.pyc113460644editdlrm
PackageTools.pyo113460644editdlrm
__init__.py00644editdlrm
__init__.pyc1410644editdlrm
__init__.pyo1410644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyc (12025B)
Ñò 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((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyt _fqhostnames  tErrorcBseZRS((t__name__t __module__(((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyt__init__Ps   cCs=|io|idƒnyti|iƒWnnXdS(Ni(RRRt deregister(R((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyR4scCs(d|_y||iƒWnnXdS(s/ Remove any existing lock on the file. iN(RR(RR,((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyt remove_locks  cCs d|ii|it|ƒfS(Ns<%s for "%s" at %x>(t __class__RRtid(R((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyt__repr__s (RRt__doc__RR3RRR%R$R RRR R R+R,RR-R!R R4R:R=(((s6/usr/lib64/python2.6/site-packages/mx/Misc/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'((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyROs  cCs.|iodStii|iƒodSdS(Nii(RRRtisdirR(R((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyR-`s  cCsp|iob|iƒ}|tiƒ|ijo8yti|iƒWntij o }dSXdSqlndS(Nii(R3R4R%RRARR(RR6R2((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyR4ƒscCs(d|_y||iƒWnnXdS(Ni(RR(RRA((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyR:s  (RRR>R%R$R RRR R R@R+RARR-R R!R4R:(((s6/usr/lib64/python2.6/site-packages/mx/Misc/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((s6/usr/lib64/python2.6/site-packages/mx/Misc/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(((s6/usr/lib64/python2.6/site-packages/mx/Misc/FileLock.pyt s 0íq