Also ignore alerts modules
This commit is contained in:
parent
c67e1bfb8b
commit
a5a07d447d
2 changed files with 18 additions and 12 deletions
|
|
@ -90,9 +90,10 @@ class RuleModule:
|
|||
|
||||
class AlertsModule:
|
||||
|
||||
def __init__(self, alerts=[]):
|
||||
def __init__(self, alerts=[], ignore_module=[]):
|
||||
self.icon_size = 50
|
||||
self.alerts = alerts
|
||||
self.ignore_module = ignore_module
|
||||
|
||||
def draw_alert(self, alert, width, image, draw, fnt_R, fnt_B, align, font_size):
|
||||
if "icon" in alert and alert["icon"] is not None:
|
||||
|
|
@ -151,6 +152,10 @@ class AlertsModule:
|
|||
alert = alert["module"]
|
||||
|
||||
if isinstance(alert, type):
|
||||
if alert.__name__ in self.ignore_module:
|
||||
logging.info("Skip module " + alert.__name__ + ", as requested by arguments")
|
||||
continue
|
||||
|
||||
try:
|
||||
for alert in alert(*args_module).gen_alerts(*args_func):
|
||||
align = self.draw_alert(alert, width, image, draw, fnt_R, fnt_B, align, font_size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue