change to import conf

This commit is contained in:
Data-Monkey
2023-05-24 22:34:09 +10:00
parent 3adfa2c268
commit 0db7521bee
16 changed files with 375 additions and 373 deletions

View File

@@ -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