pid
PidFile class featuring:
stale detection
pidfile locking (fcntl)
chmod (default is 0o644)
chown
custom exceptions
Context Manager
PidFile can be used as a context manager:
from pid import PidFile with PidFile(): do_something()
Decorator
PidFile can also be used a a decorator:
from pid.decorator import pidfile @pidfile() def main(): pass if __name__ == "__main__": main()
Exception Order
In default mode PidFile will try to acquire a file lock before anything else. This means that normally you get a PidFileAlreadyLockedError instead of the PidFileAlreadyRunningError when running a program twice.
If you just want to know if a program is already running its easiest to catch just PidFileError since it will capture all possible PidFile exceptions.
Metadata
Release files for pid 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pid-1.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pid-1.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / pid-1.1.0.tar.gz
| Download URL | pid-1.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
590898b5bb20e85589605a0a5e124acb77ee84fa3c95910e5b81409defe3c1a5
|
|
BLAKE2b-256 checksum How to use checksums |
a4c05200173e3dba219bb890da2ff9600da766667b2a7eeb5a7602ad9ddd04ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pid-1.1.0-py2.py3-none-any.whl
| Download URL | pid-1.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ac3c5aa6e99798e2018dc9c32782f76ae3e1d7c42f04c50746dfaf6ea87d5cf0
|
|
BLAKE2b-256 checksum How to use checksums |
181b78c988741f197a9447ead816e7b44889f2024bd39d719080e8250c9fdb69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |