qgreenland/util/config.py
def _load_config(config_filename, *, config_dir, schema_dir):
    """Validate config file against schema with Yamale.

    It is expected that the given config filename in CONFIG_DIR has a schema of
    matching name in CONFIG_SCHEMA_DIR.

    Yamale can read in directories of config files, so it returns a list of
    (data, fp) tuples. We always read single files, so we return just the data
    from result[0][0].
    """
    config_fp = os.path.join(config_dir, config_filename)
    schema_fp = os.path.join(schema_dir, config_filename)

    if not os.path.isfile(config_fp):
        raise NotImplementedError(
            'Loading is supported for only one config file at a time.'
        )

    schema = yamale.make_schema(schema_fp)
    config = yamale.make_data(config_fp)
    yamale.validate(schema, config, strict=True)

    return config[0][0]
Validate config file against schema with Yamale.

    It is expected that the given config filename in CONFIG_DIR has a schema of
    matching name in CONFIG_SCHEMA_DIR.

    Yamale can read in directories of config files, so it returns a list of
    (data, fp) tuples. We always read single files, so we return just the data
    from result[0][0].
    
Validate config file against schema with Yamale.
It is expected that the given config filename in CONFIG_DIR has a schema of
matching name in CONFIG_SCHEMA_DIR.

Yamale can read in directories of config files, so it returns a list of
(data, fp) tuples. We always read single files, so we return just the data
from result[0][0].
Validate config file against schema with Yamale . It is expected that the given config filename in CONFIG_DIR has a schema of matching name in CONFIG_SCHEMA_DIR . Yamale can read in directories of config files so it returns a list of ( data fp ) tuples . We always read single files so we return just the data from result [ 0 ] [ 0 ] .
def _load_config(config_filename, *, config_dir, schema_dir):
    config_fp = os.path.join(config_dir, config_filename)
    schema_fp = os.path.join(schema_dir, config_filename)
    if not os.path.isfile(config_fp):
        raise NotImplementedError(
            'Loading is supported for only one config file at a time.'
        )
    schema = yamale.make_schema(schema_fp)
    config = yamale.make_data(config_fp)
    yamale.validate(schema, config, strict=True)
    return config[0][0]
def _load_config ( config_filename , * , config_dir , schema_dir ) : config_fp = os . path . join ( config_dir , config_filename ) schema_fp = os . path . join ( schema_dir , config_filename ) if not os . path . isfile ( config_fp ) : raise NotImplementedError ( 'Loading is supported for only one config file at a time.' ) schema = yamale . make_schema ( schema_fp ) config = yamale . make_data ( config_fp ) yamale . validate ( schema , config , strict = True ) return config [ 0 ] [ 0 ]
Validate config file against schema with Yamale.
Validate config file against schema with Yamale .
"""Validate config file against schema with Yamale.

    It is expected that the given config filename in CONFIG_DIR has a schema of
    matching name in CONFIG_SCHEMA_DIR.

    Yamale can read in directories of config files, so it returns a list of
    (data, fp) tuples. We always read single files, so we return just the data
    from result[0][0].
    """
config_filename
config_dir
schema_dir