| Trees | Index | Help |
|
|---|
|
|
object --+
|
Lock
|
|||
|
__init__(self,
filename,
timeout=5,
step=0.1)
Create a Lock object on file filename |
|||
|
lock(self,
force=True)
Lock the file for access by creating a directory of the same name (plus a trailing underscore). |
|||
|
unlock(self,
ignore=True)
Release the lock. |
|||
|
_mungedname(self)
Override this in a subclass if you want to change the way Lock creates the directory name. |
|||
|
__del__(self)
Auto unlock when object is deleted. |
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Create a Lock object on file filename timeout is the time in seconds to wait before timing out, when attempting to acquire the lock. step is the number of seconds to wait in between each attempt to acquire the lock.
|
Lock the file for access by creating a directory of the same name (plus a trailing underscore). The file is only locked if you use this class to acquire the lock before accessing. If force is True (the default), then on timeout we forcibly acquire the lock. If force is False, then on timeout a LockError is raised. |
Release the lock. If ignore is True and removing the lock directory fails, then the error is surpressed. (This may happen if the lock was acquired via a timeout.) |
|
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 3.0alpha2 on Sat Apr 29 11:03:38 2006 | http://epydoc.sf.net |