1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-10 15:39:17 +00:00

migrate to yaml.safe_dump

This commit is contained in:
deadc0de6
2019-04-02 21:07:49 +02:00
parent 672d8c63a7
commit 15dd13f8b4
2 changed files with 10 additions and 5 deletions

View File

@@ -569,8 +569,9 @@ class Cfg:
"""writes the config to file"""
ret = False
with open(path, 'w') as f:
ret = yaml.dump(content, f,
default_flow_style=False, indent=2)
ret = yaml.safe_dump(content, f,
default_flow_style=False,
indent=2)
return ret
def _norm_key_elem(self, elem):
@@ -827,7 +828,9 @@ class Cfg:
self.lnk_settings[self.key_dotpath] = self.curdotpath
self.lnk_settings[self.key_workdir] = self.curworkdir
# dump
ret = yaml.dump(self.content, default_flow_style=False, indent=2)
ret = yaml.safe_dump(self.content,
default_flow_style=False,
indent=2)
ret = ret.replace('{}', '')
# restore paths
self.lnk_settings[self.key_dotpath] = dotpath