From 848fafa619a73aa99a2aa53d1acecc61c5781fd1 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Thu, 21 May 2015 08:38:37 +0200 Subject: [PATCH] insert plugin preload --- boswatch.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/boswatch.py b/boswatch.py index 2f8071e..661dc34 100644 --- a/boswatch.py +++ b/boswatch.py @@ -24,10 +24,10 @@ import subprocess def throwAlarm(typ,data): - for i in pluginloader.getPlugins(): - plugin = pluginloader.loadPlugin(i) - logging.debug("call Plugin: %s", i["name"]) + for name, plugin in pluginList.items(): + logging.debug("call Plugin: %s", name) plugin.run(typ,"0",data) + # Programm try: @@ -175,6 +175,17 @@ try: logging.debug(" - %s = %s", key, val) except: logging.exception("cannot read config file") + + + #Load Plugins + try: + logging.debug("loading plugins") + pluginList = {} + for i in pluginloader.getPlugins(): + plugin = pluginloader.loadPlugin(i) + pluginList[i["name"]] = plugin + except: + logging.exception("cannot load Plugins") logging.debug("starting rtl_fm")