mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-15 20:50:05 +00:00
allow comments in yaml
This commit is contained in:
@@ -802,7 +802,9 @@ class CfgYaml:
|
|||||||
def _yaml_load(self, path):
|
def _yaml_load(self, path):
|
||||||
"""load from yaml"""
|
"""load from yaml"""
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
content = yaml(typ='safe').load(f)
|
y = yaml()
|
||||||
|
y.typ = 'rt'
|
||||||
|
content = y.load(f)
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def _yaml_dump(self, content, path):
|
def _yaml_dump(self, content, path):
|
||||||
@@ -811,5 +813,5 @@ class CfgYaml:
|
|||||||
y = yaml()
|
y = yaml()
|
||||||
y.default_flow_style = False
|
y.default_flow_style = False
|
||||||
y.indent = 2
|
y.indent = 2
|
||||||
y.typ = 'safe'
|
y.typ = 'rt'
|
||||||
y.dump(content, f)
|
y.dump(content, f)
|
||||||
|
|||||||
Reference in New Issue
Block a user