mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-04 22:17:24 +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
|
|
@ -17,6 +17,8 @@ import socket
|
|||
|
||||
from includes import globals # Global variables
|
||||
|
||||
from includes.helper import configHandler
|
||||
|
||||
###
|
||||
#
|
||||
# onLoad (init) function of plugin
|
||||
|
|
@ -59,17 +61,7 @@ def run(typ,freq,data):
|
|||
@return: nothing
|
||||
"""
|
||||
try:
|
||||
#
|
||||
#ConfigParser
|
||||
#
|
||||
logging.debug("reading config file")
|
||||
try:
|
||||
for key,val in globals.config.items("firEmergency"):
|
||||
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("firEmergency"): #read and debug the config
|
||||
|
||||
try:
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue