def _do_notify(self, event, obj): grp = json.loads(obj.notify_grp) for mode in json.loads(obj.notify_mode): if mode == '1': spug.notify_by_wx(event, obj.name, grp) elif mode == '3': spug.notify_by_dd(event, obj.name, grp) elif mode == '4': spug.notify_by_email(event, obj.name, grp)
def _do_notify(self, event, obj, out): obj.out = out obj.grp = json.loads(obj.notify_grp) if event == '2': obj.duration = human_diff_time( datetime.now(), datetime.fromtimestamp(obj.latest_fault_time)) for mode in json.loads(obj.notify_mode): if mode == '1': spug.notify_by_wx(event, obj) elif mode == '3': spug.notify_by_dd(event, obj) elif mode == '4': spug.notify_by_email(event, obj)