aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rwxr-xr-xalarm-tools/sample.py18
2 files changed, 23 insertions, 0 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..b6fb96b
--- /dev/null
+++ b/TODO
@@ -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)