mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-08 17:40:07 +01:00
insert onLoad() routine in plugins
This commit is contained in:
parent
304b7ddeb0
commit
95d2d2f119
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
##
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
##
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue