summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e9f715b)
+def create_backend(config):
gvCookiePath = os.path.join(constants._data_path_, "gv_cookies.txt")
backend = gv_backend.GVDialer(gvCookiePath)
gvCookiePath = os.path.join(constants._data_path_, "gv_cookies.txt")
backend = gv_backend.GVDialer(gvCookiePath)
if not loggedIn:
loggedIn = backend.is_authed()
if not loggedIn:
loggedIn = backend.is_authed()
- config = ConfigParser.SafeConfigParser()
- config.read(constants._user_settings_)
if not loggedIn:
import base64
try:
if not loggedIn:
import base64
try:
except ConfigParser.NoSectionError, e:
pass
except ConfigParser.NoSectionError, e:
pass
+ assert loggedIn
+ return backend
+
+
+def is_changed(config, backend):
try:
notifyOnMissed = config.getboolean("2 - Account Info", "notifyOnMissed")
notifyOnVoicemail = config.getboolean("2 - Account Info", "notifyOnVoicemail")
try:
notifyOnMissed = config.getboolean("2 - Account Info", "notifyOnMissed")
notifyOnVoicemail = config.getboolean("2 - Account Info", "notifyOnVoicemail")
notifyOnVoicemail = False
notifyOnSms = False
notifyOnVoicemail = False
notifyOnSms = False
notifySources = []
if notifyOnMissed:
notifySources.append(("missed", get_missed))
notifySources = []
if notifyOnMissed:
notifySources.append(("missed", get_missed))
- notifyUser = is_changed()
+ config = ConfigParser.SafeConfigParser()
+ config.read(constants._user_settings_)
+ backend = create_backend(config)
+ notifyUser = is_changed(config, backend)
if notifyUser:
import led_handler
if notifyUser:
import led_handler
import sys
import datetime
import sys
import datetime
sys.path.insert(0,"/usr/lib/dialcentral/")
sys.path.insert(0,"/usr/lib/dialcentral/")
filename = "%s/notification.log" % constants._data_path_
with open(filename, "a") as file:
file.write("Notification: %r\n" % (datetime.datetime.now(), ))
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")
if notifyUser:
file.write("\tChange occurred\n")
#!/usr/bin/env python
import sys
#!/usr/bin/env python
import sys
sys.path.insert(0,"/usr/lib/dialcentral/")
sys.path.insert(0,"/usr/lib/dialcentral/")
import alarm_notify
def notify_on_change():
import alarm_notify
def notify_on_change():
- 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:
import subprocess
if notifyUser:
import subprocess