Added NASA APOD. Added Config Module
This commit is contained in:
parent
06cd25eb96
commit
d2622e25e8
6 changed files with 83 additions and 15 deletions
18
util/config.py
Normal file
18
util/config.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import json
|
||||
from util import logging
|
||||
|
||||
filepath = ""
|
||||
settings = {}
|
||||
|
||||
def load(file):
|
||||
global settings
|
||||
filepath = file
|
||||
try:
|
||||
with open(file, "r") as sett_file:
|
||||
settings = json.load(sett_file)
|
||||
logging.info(f"Trying {filepath}.....Success!")
|
||||
return True
|
||||
except Exception as e:
|
||||
logging.info(f"Trying {filepath}.....Failed!")
|
||||
logging.error(str(e))
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue