install notifiers first

This commit is contained in:
əlemi 2022-04-19 03:22:53 +02:00
parent 148c809628
commit db01f5d5b7
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -13,7 +13,7 @@ from dataclasses import dataclass, MISSING, fields
from setproctitle import setproctitle
from .treepuncher import Treepuncher, MissingParameterError, Addon, ConfigObject
from .treepuncher import Treepuncher, MissingParameterError, Addon, ConfigObject, Notifier
from .helpers import configure_logging
def main():
@ -97,8 +97,15 @@ def main():
)
)
# TODO ugly af! notifiers get installed first tho
for addon in addons:
if addon.__name__.lower() in enabled_addons:
if addon.__name__.lower() in enabled_addons and issubclass(addon, Notifier):
logging.info("Installing '%s'", addon.__name__)
client.install(addon)
for addon in addons:
if addon.__name__.lower() in enabled_addons and not issubclass(addon, Notifier):
logging.info("Installing '%s'", addon.__name__)
client.install(addon)