aerial

The easy way to catch signals


Keywords
aerial, signals, signal, unix, sighup, sigterm
License
BSD-3-Clause
Install
pip install aerial==0.1.0

Documentation

aerial

A Python library for receiving Unix style signals.

Build Status Coverage Status Package Status

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