""" Script used to send notifications for review on IRC. """ from dataclasses import dataclass import time EXECUTE_EVERY = 1 EXECUTE_AT = 2 EXECUTE_AFTER = 3 @dataclass class Event: callback : str = "" scheduler_type : int = 1 scheduler_delay : int = 60 def init(self, scheduler, callback_func): self.scheduler = scheduler self.callback_func = callback_func if self.scheduler_type == EXECUTE_EVERY: self.scheduler.execute_every(self.scheduler_delay, self._run) elif self.scheduler_type == EXECUTE_AT: self.scheduler.execute_at(self.scheduler_delay, self._run) elif self.scheduler_type == EXECUTE_AFTER: self.scheduler.execute_after(self.scheduler_delay, self._run) def _run(self): self.run(time.localtime()) def run(self, now): pass