|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/usr/lib/python2.4/site-packages/mx/Misc/ |
Upload File : |
mò
õÔ5;c @ s² d Z d k l Z d k Z d k Z d k Z d k Z d d d „ Z e ƒ \ Z Z d e i
f d „ ƒ YZ e Z d f d „ ƒ YZ
e
Z d
„ Z e d j o e ƒ n d S(
s FileLock - Implements a file lock mechanism that does not depend
on fcntl.
Copyright (c) 1997-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
( s
ExitFunctionsNt localhosts 127.0.0.1c C s• y
d k } Wn t j
o | Sn XyC | d j o | i ƒ } n | i | ƒ } | i | ƒ d } Wn | i j
o | Sn X| | f Sd S( 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.
Ni (
t sockett ImportErrort defaultt hostnamet Nonet gethostnamet
gethostbynamet ipt
gethostbyaddrt error( R R R R ( ( t4 /usr/lib/python2.4/site-packages/mx/Misc/FileLock.pyt _fqhostname s
t Errorc B s t Z RS( N( t __name__t
__module__( ( ( R R
, s t SymbolicFileLockc B s‰ t Z d Z d Z d „ Z d „ Z d d e i e e i e i
e e d „ Z
d e i e e i e i
d „ Z e i d „ Z d „ Z RS(
sÚ Implements a file lock mechanism that uses symbolic links
for locking.
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)
i c C s3 | | _ | d | _ d | _ t i | i ƒ d S( Ns .lockedi ( t filenamet selft lockfilenamet lockedt
ExitFunctionst registert unlock( R R ( ( R t __init__H s
c C s= | i o | i d ƒ n y t i | i ƒ Wn n Xd S( Ni ( R R R R t
deregister( R ( ( R t __del__P s
iô f0.0001c C sä | i o d Sn | i } d | t i ƒ f } | ƒ | d } t i
i } t i }
t i } xt| | ƒ p, y |
| | ƒ Wn | j
o qœ XPn | | ƒ | ƒ | j oy"