Home | Trees | Indices | Help |
---|
|
Simple single instance application
Includes portalocker code with minor tweaks for Python 2.4+ from Jonathan Feinberg <jdf@pobox.com> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Unit tests for lock/unlock are in tests/test_singleapp>>> singleapp = SimpleSingleApp('testapp') >>> lckfile = singleapp.lckfile >>> if os.path.isfile(lckfile): ... os.unlink(fpath) >>> path, pid = singleapp.acquire() >>> path == lckfile True >>> os.path.isfile(lckfile) True >>> singleapp.checkLocked() 2 >>> singleapp.release() >>> os.path.isfile(lckfile) False
|
|||
| SingleAppError | ||
|
SimpleSingleApp A simple single instance application implemementation |
|
|||
| lock(file, flags) | ||
| unlock(file) |
|
|||
|
__author__ = 'Christian Heimes'
|
||
|
__version__ = '$Id: singleapp.py 122 2007-02-02 17:34:06Z tiran $'
|
||
|
__revision__ = '$Revision: 122 $'
|
||
|
LOG = <logging.Logger instance at 0x4054b9cc>
|
||
|
TEMPDIR = '/tmp'
|
||
|
USER = 'heimes'
|
||
|
PID = 5749
|
||
|
LOCK_EX = 2
|
||
|
LOCK_SH = 1
|
||
|
LOCK_NB = 4
|
||
|
LOCK = 6
|
|
|
|
|
__author__None
|
__version__None
|
__revision__None
|
LOGNone
|
TEMPDIRNone
|
USERNone
|
PIDNone
|
LOCK_EXNone
|
LOCK_SHNone
|
LOCK_NBNone
|
LOCKNone
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Sun Feb 4 17:00:18 2007 | http://epydoc.sourceforge.net |