X-Git-Url: http://git.maemo.org/git/?p=gc-dialer;a=blobdiff_plain;f=src%2Falarm_notify.py;h=58107103675b751e539dfe6a01e1530006c5097c;hp=8904ec6ae75061ad8c0710ee983b80269c69e255;hb=e7187c0456fba6b24a5f512ec5fa60d54e11338a;hpb=0b0fee7fba5f0bcba82ac289aaf1d2627905c25a diff --git a/src/alarm_notify.py b/src/alarm_notify.py index 8904ec6..5810710 100755 --- a/src/alarm_notify.py +++ b/src/alarm_notify.py @@ -30,12 +30,22 @@ def get_sms(backend): def remove_reltime(data): for messageData in data["messages"].itervalues(): - del messageData["relativeStartTime"] - del messageData["labels"] - del messageData["isRead"] - del messageData["isSpam"] - del messageData["isTrash"] - del messageData["star"] + for badPart in [ + "relTime", + "relativeStartTime", + "time", + "star", + "isArchived", + "isRead", + "isSpam", + "isTrash", + "labels", + ]: + if badPart in messageData: + del messageData[badPart] + for globalBad in ["unreadCounts", "totalSize", "resultsPerPage"]: + if globalBad in data: + del data[globalBad] def is_type_changed(backend, type, get_material): @@ -154,7 +164,7 @@ def notify_on_change(): if __name__ == "__main__": - logging.basicConfig(level=logging.WARNING, filename=constants._notifier_logpath_) + logging.basicConfig(level=logging.DEBUG, filename=constants._notifier_logpath_) logging.info("Notifier %s-%s" % (constants.__version__, constants.__build__)) logging.info("OS: %s" % (os.uname()[0], )) logging.info("Kernel: %s (%s) for %s" % os.uname()[2:])