diff options
-rw-r--r-- | TODO | 5 | ||||
-rwxr-xr-x | alarm-tools/sample.py | 18 |
2 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,5 @@ +- Watch /proc/<client_pid> and destroy alarms last owned by processes when they die +- Allow ownership change so long as uuid can be given +- Python binding needs more error messages, docs + - Python binding needs to hook into libalarm surely + - Python binding needs renaming diff --git a/alarm-tools/sample.py b/alarm-tools/sample.py new file mode 100755 index 0000000..0adac18 --- /dev/null +++ b/alarm-tools/sample.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +# NOTE: Requires PYTHONPATH to be set to ../lib/python if using the working +# tree module + +import alarms +import time + +if __name__ == "__main__": + sock = alarms.connect("/tmp/alarmd") + uuid = alarms.register_alarm(sock, "Test alarm") + time.sleep(10) + alarms.raise_alarm(sock, uuid) + time.sleep(10) + alarms.clear_alarm(sock, uuid) + time.sleep(10) + alarms.deregister_alarm(sock, uuid) + alarms.disconnect(sock) |