mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-05 14:35:17 +00:00
insert configHandler.checkConfig() helper in all plugins so save always same code
This commit is contained in:
parent
cbb9481c5c
commit
76686e016c
7 changed files with 18 additions and 71 deletions
|
|
@ -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:
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue