insert onLoad() routine in plugins

This commit is contained in:
Schrolli 2015-06-29 12:19:44 +02:00
parent 304b7ddeb0
commit 95d2d2f119
7 changed files with 170 additions and 12 deletions

View file

@ -19,6 +19,29 @@ import base64 #for the HTTP request with User/Password
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#
# do BosMon-Request

View file

@ -18,6 +18,28 @@ import mysql.connector
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#

View file

@ -19,6 +19,29 @@ from email.utils import make_msgid # need for confirm to RFC2822 standard
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#
# Private helper function for a printable Timestamp

View file

@ -14,6 +14,29 @@ import socket
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#
# Main function of firEmergency-plugin

View file

@ -15,6 +15,28 @@ from urlparse import urlparse #for split the URL into url and path
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#

View file

@ -16,6 +16,29 @@ import json # for data-transfer
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#
# Main function of jsonSocket-plugin

View file

@ -24,6 +24,29 @@ import logging # Global logger
from includes import globals # Global variables
##
#
# onLoad function of plugin
# will be called by the pluginLoader
#
def onLoad():
"""
While loading the plugins by pluginLoader.loadPlugins()
this onLoad() routine are called
@requires: nothing
@return: nothing
"""
try:
########## User onLoad CODE ##########
########## User onLoad CODE ##########
except:
logging.error("unknown error")
logging.debug("unknown error", exc_info=True)
##
#
# Main function of plugin
@ -57,19 +80,18 @@ def run(typ,freq,data):
except:
logging.error("cannot read config file")
logging.debug("cannot read config file", exc_info=True)
# Without config, plugin couldn't work
return
else: # Without config, plugin couldn't work
########## User Plugin CODE ##########
if typ == "FMS":
logging.warning("%s not supported", typ)
elif typ == "ZVEI":
logging.warning("%s not supported", typ)
elif typ == "POC":
logging.warning("%s not supported", typ)
else:
logging.warning("Invalid Typ: %s", typ)
########## User Plugin CODE ##########
########## User Plugin CODE ##########
if typ == "FMS":
logging.warning("%s not supported", typ)
elif typ == "ZVEI":
logging.warning("%s not supported", typ)
elif typ == "POC":
logging.warning("%s not supported", typ)
else:
logging.warning("Invalid Typ: %s", typ)
########## User Plugin CODE ##########
except:
logging.error("unknown error")