From 6ec12d94c1b25883e3588afcadd686d3dc157675 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Wed, 14 Dec 2022 22:35:33 -0600 Subject: add more files, fixed bugs related to multiple documents in yaml config --- src/pyssg/configuration.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/pyssg/configuration.py') diff --git a/src/pyssg/configuration.py b/src/pyssg/configuration.py index d7c32ae..b68930c 100644 --- a/src/pyssg/configuration.py +++ b/src/pyssg/configuration.py @@ -51,13 +51,14 @@ def __expand_all_paths(config: dict) -> None: # not necessary to type deeper than the first dict def get_parsed_config(path: str) -> list[dict]: log.debug('reading config file "%s"', path) - config: list[dict] = get_parsed_yaml(path) + config_all: list[dict] = get_parsed_yaml(path) mandatory_config: list[dict] = get_parsed_yaml('mandatory_config.yaml', 'pyssg.plt') - log.info('found %s document(s) for configuration "%s"', len(config), path) + log.info('found %s document(s) for configuration "%s"', len(config_all), path) log.debug('checking that config file is well formed (at least contains mandatory fields') - __check_well_formed_config(config[0], mandatory_config) - __expand_all_paths(config[0]) - return config + for config in config_all: + __check_well_formed_config(config, mandatory_config) + __expand_all_paths(config) + return config_all # not necessary to type deeper than the first dict, -- cgit v1.2.3-54-g00ecf