slightly rework structure
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user