Refactoring in case I want to use some of the notify stuff in Dialcentral
[gc-dialer] / src / examples / log_notifier.py
index 7c0ce24..6e63b5d 100644 (file)
@@ -4,6 +4,7 @@ from __future__ import with_statement
 
 import sys
 import datetime
+import ConfigParser
 
 
 sys.path.insert(0,"/usr/lib/dialcentral/")
@@ -17,7 +18,12 @@ def notify_on_change():
        filename = "%s/notification.log" % constants._data_path_
        with open(filename, "a") as file:
                file.write("Notification: %r\n" % (datetime.datetime.now(), ))
-               notifyUser = alarm_notify.is_changed()
+
+               config = ConfigParser.SafeConfigParser()
+               config.read(constants._user_settings_)
+               backend = alarm_notify.create_backend(config)
+               notifyUser = alarm_notify.is_changed(config, backend)
+
                if notifyUser:
                        file.write("\tChange occurred\n")