mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-05 14:35:17 +00:00
move loadPlugins() pHanlder->pLoader
This commit is contained in:
parent
22db39efcf
commit
82a837c19e
3 changed files with 13 additions and 15 deletions
|
|
@ -11,16 +11,4 @@ def throwAlarm(typ,freq,data):
|
|||
for name, plugin in globals.pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,freq,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")
|
||||
logging.debug("[END ALARM]")
|
||||
|
|
@ -7,6 +7,15 @@ import os
|
|||
|
||||
from includes import globals # Global variables
|
||||
|
||||
def loadPlugins():
|
||||
try:
|
||||
logging.debug("loading plugins")
|
||||
for i in getPlugins():
|
||||
plugin = loadPlugin(i)
|
||||
globals.pluginList[i["name"]] = plugin
|
||||
except:
|
||||
logging.exception("cannot load Plugins")
|
||||
|
||||
|
||||
def getPlugins():
|
||||
try:
|
||||
|
|
@ -34,6 +43,7 @@ def getPlugins():
|
|||
|
||||
return plugins
|
||||
|
||||
|
||||
def loadPlugin(plugin):
|
||||
try:
|
||||
logging.debug("load Plugin: %s", plugin["name"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue