mirror of
https://github.com/YunoHost-Apps/mautrix_signal_ynh.git
synced 2024-09-03 19:46:07 +02:00
070b255e0e
Also add a helper "yaml2json" python script to allow using jq from the shell to query config values.
18 lines
234 B
Python
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)
|