Notification Support has been tested to a limited degree on a device
[gc-dialer] / src / examples / log_notifier.py
1 #!/usr/bin/env python
2
3 from __future__ import with_statement
4
5 import sys
6 import datetime
7
8
9 sys.path.insert(0,"/usr/lib/dialcentral/")
10
11
12 import constants
13 import alarm_notify
14
15
16 def notify_on_change():
17         filename = "%s/notification.log" % constants._data_path_
18         with open(filename, "a") as file:
19                 file.write("Notification: %r\n" % (datetime.datetime.now(), ))
20                 notifyUser = alarm_notify.is_changed()
21                 if notifyUser:
22                         file.write("\tChange occurred\n")
23
24
25 if __name__ == "__main__":
26         notify_on_change()