slightly rework structure

This commit is contained in:
2022-08-22 09:14:27 +02:00
parent f1321faef0
commit 7b158ac72b
3 changed files with 890 additions and 765 deletions

View File

@ -27,3 +27,14 @@ def read_data(filename):
filepath = os.path.join(DATA_DIR, filename)
with open(filepath, 'r') as fd:
return yaml.safe_load(fd)
def rewrite_data(filename, data):
"""Rewrites data formatting it
"""
from ruamel.yaml import YAML
_yaml = YAML()
_yaml.indent(mapping=2, sequence=4, offset=2)
filepath = os.path.join(DATA_DIR, filename)
with open(filepath, 'w') as fd:
_yaml.dump(data, fd)