2019-10-25 19:28:44 +00:00
|
|
|
from ...backend_config import Config
|
2025-01-26 20:50:49 +00:00
|
|
|
from ...backend_config.defs import ENV_CONFIG_VERBOSE
|
2025-01-26 21:03:16 +00:00
|
|
|
from ..._vendor.pathlib2 import Path
|
2019-10-25 19:28:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
def load(*additional_module_paths):
|
|
|
|
# type: (str) -> Config
|
|
|
|
"""
|
|
|
|
Load configuration with the API defaults, using the additional module path provided
|
|
|
|
:param additional_module_paths: Additional config paths for modules who'se default
|
|
|
|
configurations should be loaded as well
|
|
|
|
:return: Config object
|
|
|
|
"""
|
2025-01-26 20:50:49 +00:00
|
|
|
config = Config(verbose=ENV_CONFIG_VERBOSE.get(default=False))
|
2019-10-25 19:28:44 +00:00
|
|
|
this_module_path = Path(__file__).parent
|
|
|
|
config.load_relative_to(this_module_path, *additional_module_paths)
|
|
|
|
return config
|