insert configHandler.checkConfig() helper in all plugins so save always same code

This commit is contained in:
Schrolli 2015-07-09 07:52:21 +02:00
parent cbb9481c5c
commit 76686e016c
7 changed files with 18 additions and 71 deletions

View file

@ -16,6 +16,8 @@ import json # for data-transfer
from includes import globals # Global variables
from includes.helper import configHandler
##
#
# onLoad (init) function of plugin
@ -58,18 +60,7 @@ def run(typ,freq,data):
@return: nothing
"""
try:
#
# ConfigParser
#
logging.debug("reading config file")
try:
for key,val in globals.config.items("jsonSocket"):
logging.debug(" - %s = %s", key, val)
except:
logging.error("cannot read config file")
logging.debug("cannot read config file", exc_info=True)
else: # Without config, plugin couldn't work
if configHandler.checkConfig("jsonSocket"): #read and debug the config
try:
#