BOSWatch/includes/pluginHandler.py
JHCD e67a357d8e (re-)structure code - use include-files now
- move gobals and other stuff to includes
- extract code from boswatch.py to include-files

bugfix in BosMon-plugin
2015-05-22 16:44:23 +02:00

26 lines
625 B
Python

#!/usr/bin/python
# -*- coding: cp1252 -*-
import logging
from includes import globals # Global variables
from includes import pluginloader
def throwAlarm(typ,data):
logging.debug("[ ALARM ]")
for name, plugin in globals.pluginList.items():
logging.debug("call Plugin: %s", name)
plugin.run(typ,"0",data)
logging.debug("[END ALARM]")
def loadPlugins():
try:
#load plugins
logging.debug("loading plugins")
for i in pluginloader.getPlugins():
plugin = pluginloader.loadPlugin(i)
globals.pluginList[i["name"]] = plugin
except:
logging.exception("cannot load Plugins")