mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 11:14:17 +00:00
linting
This commit is contained in:
@@ -10,6 +10,7 @@ import json
|
|||||||
|
|
||||||
# pip install toml deepdiff
|
# pip install toml deepdiff
|
||||||
|
|
||||||
|
|
||||||
def _yaml_load(path):
|
def _yaml_load(path):
|
||||||
"""load from yaml"""
|
"""load from yaml"""
|
||||||
with open(path, 'r', encoding='utf8') as file:
|
with open(path, 'r', encoding='utf8') as file:
|
||||||
@@ -18,6 +19,7 @@ def _yaml_load(path):
|
|||||||
content = data.load(file)
|
content = data.load(file)
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
def _yaml_dump(content, where):
|
def _yaml_dump(content, where):
|
||||||
"""dump to yaml"""
|
"""dump to yaml"""
|
||||||
data = yaml()
|
data = yaml()
|
||||||
@@ -26,6 +28,7 @@ def _yaml_dump(content, where):
|
|||||||
data.typ = 'rt'
|
data.typ = 'rt'
|
||||||
data.dump(content, where)
|
data.dump(content, where)
|
||||||
|
|
||||||
|
|
||||||
def _toml_load(path):
|
def _toml_load(path):
|
||||||
"""load from toml"""
|
"""load from toml"""
|
||||||
with open(path, 'r', encoding='utf8') as file:
|
with open(path, 'r', encoding='utf8') as file:
|
||||||
@@ -33,10 +36,12 @@ def _toml_load(path):
|
|||||||
content = toml.loads(data)
|
content = toml.loads(data)
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
def _toml_dump(content, where):
|
def _toml_dump(content, where):
|
||||||
with open(where, 'w') as f:
|
with open(where, 'w') as f:
|
||||||
toml.dump(content, f)
|
toml.dump(content, f)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 3:
|
||||||
print("usage:")
|
print("usage:")
|
||||||
|
|||||||
Reference in New Issue
Block a user