The easy way to catch signals
Project description
A Python library for receiving Unix style signals.
This library is meant to be a simple way to deal with handling signals, while avoiding callbacks.
Install it with pip
pip install aerial
A simple use looks like this:
>>> import time
>>> import signal
>>>
>>> import aerial
>>> def main_loop():
... while not aerial.received(signal.SIGTERM):
... if aerial.received(signal.SIGHUP):
... print('got a SIGHUP')
... time.sleep(.5)
... print('See you later')
...
>>>
And try out the demo by running the module.
python -m aerial
[ PID 10852 ] Hello, send me a SIGTERM to exit, or a SIGHUP for a trick # In another terminal
[ PID 10852 ] Neat huh? # kill -SIGHUP 10852
[ PID 10852 ] See you later # kill -SIGTERM 10852
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aerial-0.0.6.tar.gz
(20.1 kB
view details)
Built Distribution
File details
Details for the file aerial-0.0.6.tar.gz
.
File metadata
- Download URL: aerial-0.0.6.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa10181bb4ec47da863b3d4720972ac104d6963165965814d4b7629431125cc1 |
|
MD5 | 5b881b683bf968b2ea91476117075b96 |
|
BLAKE2b-256 | 6f7acdcac731a748d26a248b26a12f68a1dd2aa060d832522df407a289a2a61c |
File details
Details for the file aerial-0.0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: aerial-0.0.6-py2.py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae329e51d914895582c553fa7a2832c2adeacf614601dbc314b538252c4ce64 |
|
MD5 | 04688094b8218e943571a54a5e81f093 |
|
BLAKE2b-256 | a9550df8485b0a1aa1cfe480b1dd9cc8108b816f47fb3f698134d2c81a4a848a |