From db01f5d5b78a6ef323e8c0c78b3e533fbf26cc85 Mon Sep 17 00:00:00 2001 From: alemidev Date: Tue, 19 Apr 2022 03:22:53 +0200 Subject: [PATCH] install notifiers first --- src/treepuncher/__main__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/treepuncher/__main__.py b/src/treepuncher/__main__.py index 6bba175..27a40d6 100644 --- a/src/treepuncher/__main__.py +++ b/src/treepuncher/__main__.py @@ -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(): @@ -96,9 +96,16 @@ def main(): args.add if args.add is not None else client.config.sections() ) ) - + + # 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)