From b92791ce042faa8401072bc965b53c5e28b62949 Mon Sep 17 00:00:00 2001 From: Francesco Tolomei <80046572+f-tlm@users.noreply.github.com> Date: Tue, 26 Apr 2022 02:31:42 +0200 Subject: [PATCH] windows fix --- src/treepuncher/__main__.py | 3 ++- src/treepuncher/treepuncher.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/treepuncher/__main__.py b/src/treepuncher/__main__.py index 0c3b3cc..6a8f80a 100644 --- a/src/treepuncher/__main__.py +++ b/src/treepuncher/__main__.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os import re +import sys import asyncio import logging import argparse @@ -24,7 +25,7 @@ def main(): addons : Set[Type[Addon]] = set() for path in sorted(addon_path.rglob('*.py')): - py_path = str(path).replace('/', '.').replace('.py', '') + py_path = str(path).replace('/', '.').replace('\\', '.').replace('.py', '') try: m = import_module(py_path) for obj_name in vars(m).keys(): diff --git a/src/treepuncher/treepuncher.py b/src/treepuncher/treepuncher.py index d0d9823..25d208b 100644 --- a/src/treepuncher/treepuncher.py +++ b/src/treepuncher/treepuncher.py @@ -235,8 +235,10 @@ class Treepuncher( await super().start() if not self.notifier: self.notifier = Notifier(self) + await self.notifier.initialize() for m in self.modules: - await m.initialize() + if not isinstance(m, Notifier): + await m.initialize() self._processing = True self._worker = asyncio.get_event_loop().create_task(self._work()) self.scheduler.resume()