1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 14:31:46 +00:00
This commit is contained in:
deadc0de6
2022-03-08 15:46:08 +01:00
parent 8a2dc9184a
commit 37d2c7c684

View File

@@ -10,6 +10,7 @@ import json
# pip install toml deepdiff
def _yaml_load(path):
"""load from yaml"""
with open(path, 'r', encoding='utf8') as file:
@@ -18,6 +19,7 @@ def _yaml_load(path):
content = data.load(file)
return content
def _yaml_dump(content, where):
"""dump to yaml"""
data = yaml()
@@ -26,6 +28,7 @@ def _yaml_dump(content, where):
data.typ = 'rt'
data.dump(content, where)
def _toml_load(path):
"""load from toml"""
with open(path, 'r', encoding='utf8') as file:
@@ -33,10 +36,12 @@ def _toml_load(path):
content = toml.loads(data)
return content
def _toml_dump(content, where):
with open(where, 'w') as f:
toml.dump(content, f)
if __name__ == '__main__':
if len(sys.argv) < 3:
print("usage:")