spaceapi-server/spaceapi_server/config/__init__.py
2019-11-25 02:48:12 +01:00

25 lines
448 B
Python

import json
# The parsed config object
__CONFIG = {}
def load(filename: str) -> None:
'''
Load a JSON-formatted configuration file.
@param filename The config file to load.
'''
global __CONFIG
# Open and parse the JSON config file
with open(filename, 'r') as conf:
__CONFIG = json.load(conf)
def get() -> dict:
'''
Return the current configuration.
'''
global __CONFIG
return __CONFIG