change to import conf
This commit is contained in:
@@ -23,4 +23,15 @@ def get_file_content(path):
|
||||
content = f.read()
|
||||
f.close()
|
||||
|
||||
return content
|
||||
return content
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
def read_config_file(filename):
|
||||
"""
|
||||
retuns dict on the config file key:value pairs
|
||||
"""
|
||||
# load the variables from pialert.conf
|
||||
code = compile(filename.read_text(), filename.name, "exec")
|
||||
confDict = {} # config dictionary
|
||||
exec(code, {"__builtins__": {}}, confDict)
|
||||
return confDict
|
||||
Reference in New Issue
Block a user