mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-05 14:35:17 +00:00
use globals.config
This commit is contained in:
parent
5f667678d9
commit
76222da522
4 changed files with 18 additions and 23 deletions
|
|
@ -7,23 +7,21 @@ import globals # Global variables
|
|||
def run(typ,freq,data):
|
||||
try:
|
||||
#ConfigParser
|
||||
#config Data in config["OPTION"]
|
||||
logging.debug("reading config file")
|
||||
try:
|
||||
config = dict(globals.config.items("template"))
|
||||
for key,val in config.items():
|
||||
for key,val in globals.config.items("BOSWatch"):
|
||||
logging.debug(" - %s = %s", key, val)
|
||||
except:
|
||||
logging.exception("cannot read config file")
|
||||
|
||||
if typ == "FMS":
|
||||
logging.debug("FMS: %s Status: %s Dir: %s TKI: %s", data["fms"], data["status"], data["direction"], data["tki"])
|
||||
logging.debug(typ + " not supported")
|
||||
elif typ == "ZVEI":
|
||||
logging.debug("ZVEI: %s", data["zvei"])
|
||||
logging.debug(typ + " not supported")
|
||||
elif typ == "POC":
|
||||
logging.debug("POC: %s-%s - %s", data["ric"], data["function"], data["msg"])
|
||||
logging.debug(typ + " not supported")
|
||||
else:
|
||||
logging.warning(typ + " not supportet")
|
||||
logging.warning(typ + " not supported")
|
||||
|
||||
except:
|
||||
logging.exception("unknown error")
|
||||
Loading…
Add table
Add a link
Reference in a new issue