BOSWatch/plugin_test/plugins/template/template.py
2015-05-20 09:38:30 +02:00

28 lines
769 B
Python

#!/usr/bin/python
# -*- coding: cp1252 -*-
import logging # Global logger
import globals # Global variables
def run(typ,freq,data):
try:
#ConfigParser
logging.debug("reading config file")
try:
config = dict(globals.config.items("template"))
for key,val in config.items():
logging.debug(" - %s = %s", key, val)
except:
logging.exception("cannot read config file")
if typ == "FMS":
logging.debug("FMS: %s Status: %s Dir: %s", data["fms"], data["status"], data["direction"])
elif typ == "ZVEI":
logging.debug("ZVEI: %s", data["zvei"])
elif typ == "POC":
logging.debug("POC: %s/%s - %s", data["ric"], data["function"], data["msg"])
else:
logging.warning(typ + " not supportet")
except:
logging.exception("unknown error")