Patch up comment block preservation to not depend on the original object getting passed from load to save, by reading comment block at write-time. Also removes the need for another YAML serializer.

This commit is contained in:
Eric Mill
2014-03-30 19:26:25 -04:00
parent 30cccde401
commit 31f5c2e685
2 changed files with 21 additions and 31 deletions

View File

@@ -328,7 +328,8 @@ def yaml_load(path, use_cache=True):
return data
def yaml_dump(data, path):
rtyaml.dump(data, open(path, "w"))
# open for reading as well as writing
rtyaml.dump(data, open(path, "r+"))
# Store in a pickled file for fast access later.
import cPickle as pickle, hashlib