mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 14:31:46 +00:00
linting
This commit is contained in:
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user