mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 19:40:15 +00:00
handle mandatory entries in config with toml
This commit is contained in:
@@ -28,7 +28,11 @@ def replace_None(content):
|
|||||||
"""replace any occurence of None with empty string"""
|
"""replace any occurence of None with empty string"""
|
||||||
n = {}
|
n = {}
|
||||||
for k in content:
|
for k in content:
|
||||||
if not content[k]:
|
if content[k] is None:
|
||||||
|
if k == 'dotfiles':
|
||||||
|
continue
|
||||||
|
if k == 'profiles':
|
||||||
|
continue
|
||||||
n[k] = ""
|
n[k] = ""
|
||||||
continue
|
continue
|
||||||
if isinstance(content[k], dict):
|
if isinstance(content[k], dict):
|
||||||
@@ -50,6 +54,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
path = sys.argv[1]
|
path = sys.argv[1]
|
||||||
content = yaml_load(path)
|
content = yaml_load(path)
|
||||||
|
#print(content)
|
||||||
content = replace_None(content)
|
content = replace_None(content)
|
||||||
out = toml_dump(content)
|
out = toml_dump(content)
|
||||||
print(out)
|
print(out)
|
||||||
|
|||||||
Reference in New Issue
Block a user