change pluginLoader and exception-handling

- if the function plugin.onLoad() throws an exception the plugin will skipped
- change exception-handling for pluginLoader
This commit is contained in:
JHCD 2015-06-29 23:24:48 +02:00
parent a1d610ee6a
commit 09b9cc5f7d
9 changed files with 100 additions and 72 deletions

View file

@ -26,17 +26,19 @@ from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
# onLoad (init) function of plugin
# will be called one time by the pluginLoader on start
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
this onLoad() routine is called one time for initialize the plugin
@requires: nothing
@return: nothing
@exception: Exception if init has an fatal error so that the plugin couldn't work
"""
try:
########## User onLoad CODE ##########
@ -45,6 +47,7 @@ def onLoad():
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
raise
##
#
@ -67,6 +70,7 @@ def run(typ,freq,data):
@requires: If necessary the configuration hast to be set in the config.ini.
@return: nothing
@exception: nothing, make sure this function will never thrown an exception
"""
try:
#