mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2025-12-31 13:50:34 +01:00
Merge branch 'develop' of https://github.com/Schrolli91/BOSWatch into develop
This commit is contained in:
commit
8ef7a46dac
|
|
@ -131,8 +131,8 @@ try:
|
|||
else:
|
||||
|
||||
#load plugins
|
||||
from includes import pluginloader
|
||||
pluginloader.loadPlugins()
|
||||
from includes import pluginLoader
|
||||
pluginLoader.loadPlugins()
|
||||
|
||||
try:
|
||||
#start rtl_fm
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
import logging
|
||||
|
||||
from includes import globals # Global variables
|
||||
from includes import pluginloader
|
||||
|
||||
def processAlarm(typ,freq,data):
|
||||
logging.debug("[ ALARM ]")
|
||||
for name, plugin in globals.pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,freq,data)
|
||||
logging.debug("return from: %s", name)
|
||||
logging.debug("[END ALARM]")
|
||||
|
|
@ -12,7 +12,8 @@ import os #for log mkdir
|
|||
import time #timestamp for doublealarm
|
||||
|
||||
from includes import globals # Global variables
|
||||
from includes import pluginloader
|
||||
from includes import pluginLoader
|
||||
from includes import alarmHandler
|
||||
|
||||
#create new logger
|
||||
logger = logging.getLogger()
|
||||
|
|
@ -49,15 +50,7 @@ except:
|
|||
logging.exception("cannot read config file")
|
||||
|
||||
|
||||
try:
|
||||
logging.debug("loading plugins")
|
||||
pluginList = {}
|
||||
for i in pluginloader.getPlugins():
|
||||
plugin = pluginloader.loadPlugin(i)
|
||||
pluginList[i["name"]] = plugin
|
||||
logging.debug("loading ready")
|
||||
except:
|
||||
logging.exception("cannot load Plugins")
|
||||
pluginLoader.loadPlugins()
|
||||
|
||||
|
||||
# ----- Test Data ----- #
|
||||
|
|
@ -75,11 +68,7 @@ while True:
|
|||
time.sleep(1)
|
||||
|
||||
print ""
|
||||
logging.debug("[ ALARM ]")
|
||||
for name, plugin in pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,"0",data)
|
||||
logging.debug("[END ALARM]")
|
||||
alarmHandler.processAlarm(typ,"0",data)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logging.warning("Keyboard Interrupt")
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ def run(typ,freq,data):
|
|||
logging.exception("cannot get HTTP response")
|
||||
|
||||
finally:
|
||||
logging.debug("close http-Connection")
|
||||
logging.debug("close HTTP-Connection")
|
||||
httprequest.close()
|
||||
########## User Plugin CODE ##########
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue