Skip to content

Commit 6535ba8

Browse files
authored
Merge pull request #21 from BerkeleyAutomation/yaml_fix
fix so that yaml prints in readable fashion
2 parents 06970d1 + 7948aea commit 6535ba8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autolab_core/yaml_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def iteritems(self):
7070

7171
def save(self, filename):
7272
""" Save a YamlConfig to disk. """
73-
yaml.dump(self, open(filename, 'w'))
73+
y = yaml.YAML()
74+
y.dump(self.config, open(filename, 'w'))
7475

7576
def _load_config(self, filename):
7677
"""Loads a yaml configuration file from the given filename.
@@ -91,7 +92,7 @@ def _load_config(self, filename):
9192
def recursive_load(matchobj, path):
9293
first_spacing = matchobj.group(1)
9394
other_spacing = first_spacing.replace('-', ' ')
94-
fname = os.path.join(path, matchobj.group(2))
95+
fname = os.path.join(path, matchobj.group(2).rstrip())
9596
new_path, _ = os.path.split(fname)
9697
new_path = os.path.realpath(new_path)
9798
text = ''

0 commit comments

Comments
 (0)