Mercurial > nagslang
comparison nagslang/yamlish.py @ 141:076448ba0582
Add a trailing newline
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Mon, 02 Sep 2013 19:04:36 +0200 |
parents | 366b334a7018 |
children | 1d73867becbe |
comparison
equal
deleted
inserted
replaced
140:f36a7075d9a0 | 141:076448ba0582 |
---|---|
29 return Parser().parse(yaml.strip()) | 29 return Parser().parse(yaml.strip()) |
30 | 30 |
31 | 31 |
32 class Dumper(object): | 32 class Dumper(object): |
33 def dump(self, data): | 33 def dump(self, data): |
34 return '\n'.join(self._dump_block(data)) | 34 return '\n'.join(self._dump_block(data)) + '\n' |
35 | 35 |
36 def _dump_block(self, data, indent=0): | 36 def _dump_block(self, data, indent=0): |
37 for type_ in (list, tuple, dict): | 37 for type_ in (list, tuple, dict): |
38 if isinstance(data, type_): | 38 if isinstance(data, type_): |
39 f = getattr(self, '_dump_%s_block' % type_.__name__) | 39 f = getattr(self, '_dump_%s_block' % type_.__name__) |