1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mautrix_signal_ynh.git synced 2024-09-03 19:46:07 +02:00
mautrix_signal_ynh/scripts/yaml2json.py
Mayeul Cantan 070b255e0e Handle missing enable_relaybot setting
Also add a helper "yaml2json" python script to allow using jq from the
shell to query config values.
2024-04-28 21:49:58 +02:00

18 lines
234 B
Python

#!/usr/bin/python
# Usage: yaml2json.py <file>
import sys
import yaml
import json
assert len(sys.argv) == 2, "Expected a file as argument"
with open(sys.argv[1], "r") as f:
y = yaml.safe_load(f)
j = json.dumps(y)
print(j)