Changeset View
Changeset View
Standalone View
Standalone View
swh/core/config.py
Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | def parse_config_file(cls, base_filename=None, config_filename=None, | ||||
allows to override or extend the configuration set in | allows to override or extend the configuration set in | ||||
cls.DEFAULT_CONFIG. | cls.DEFAULT_CONFIG. | ||||
- global_config (bool): Load the global configuration (default: | - global_config (bool): Load the global configuration (default: | ||||
True) | True) | ||||
""" | """ | ||||
if config_filename: | if config_filename: | ||||
config_filenames = [config_filename] | config_filenames = [config_filename] | ||||
elif 'SWH_CONFIG_FILENAME' in os.environ: | |||||
config_filenames = [os.environ['SWH_CONFIG_FILENAME']] | |||||
else: | else: | ||||
if not base_filename: | if not base_filename: | ||||
base_filename = cls.CONFIG_BASE_FILENAME | base_filename = cls.CONFIG_BASE_FILENAME | ||||
config_filenames = swh_config_paths(base_filename) | config_filenames = swh_config_paths(base_filename) | ||||
if not additional_configs: | if not additional_configs: | ||||
additional_configs = [] | additional_configs = [] | ||||
full_default_config = merge_default_configs(cls.DEFAULT_CONFIG, | full_default_config = merge_default_configs(cls.DEFAULT_CONFIG, | ||||
Show All 9 Lines |