Auto load any keys/values from the yaml config file.
This should allow us to remove all the boilerplate code in this file where a name is pulled from the config dict and put into the top level namespace of the settings module. We do this first so that any logic that adds more complex or dynamic keys will still run and is safe. Now that this is here we can start removing any simple boilerplate.
This commit is contained in:
@@ -38,6 +38,9 @@ CONFIG_FILE = get_env_setting('STUDIO_CFG')
|
||||
with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
|
||||
__config__ = yaml.safe_load(f)
|
||||
|
||||
# Add the key/values from config into the global namespace of this module.
|
||||
vars().update(__config__)
|
||||
|
||||
# ENV_TOKENS and AUTH_TOKENS are included for reverse compatability.
|
||||
# Removing them may break plugins that rely on them.
|
||||
ENV_TOKENS = __config__
|
||||
|
||||
@@ -50,6 +50,9 @@ CONFIG_FILE = get_env_setting('LMS_CFG')
|
||||
with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
|
||||
__config__ = yaml.safe_load(f)
|
||||
|
||||
# Add the key/values from config into the global namespace of this module.
|
||||
vars().update(__config__)
|
||||
|
||||
# ENV_TOKENS and AUTH_TOKENS are included for reverse compatability.
|
||||
# Removing them may break plugins that rely on them.
|
||||
ENV_TOKENS = __config__
|
||||
|
||||
Reference in New Issue
Block a user