fix config loader to support list inputs

This commit is contained in:
protolambda 2020-01-13 20:01:42 +01:00
parent 702b253361
commit 46be6aed1d
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623

View File

@ -18,7 +18,9 @@ def load_presets(configs_dir, presets_name) -> Dict[str, Any]:
loaded = yaml.load(path)
out = dict()
for k, v in loaded.items():
if v.startswith("0x"):
if isinstance(v, list):
out[k] = v
elif isinstance(v, str) and v.startswith("0x"):
out[k] = bytes.fromhex(v[2:])
else:
out[k] = int(v)