simplify config.load()

This commit is contained in:
Mike Fährmann
2023-02-28 22:02:15 +01:00
parent 632d5d7745
commit de2f35d068
2 changed files with 8 additions and 24 deletions

View File

@@ -43,9 +43,14 @@ def main():
if args.configs_json:
config.load(args.configs_json, strict=True)
if args.configs_yaml:
config.load(args.configs_yaml, strict=True, fmt="yaml")
import yaml
config.load(args.configs_yaml, strict=True, load=yaml.safe_load)
if args.configs_toml:
config.load(args.configs_toml, strict=True, fmt="toml")
try:
import tomllib as toml
except ImportError:
import toml
config.load(args.configs_toml, strict=True, load=toml.loads)
if args.filename:
filename = args.filename
if filename == "/O":