Changeset 137:c5ff16c66100


Ignore:
Timestamp:
Sep 2, 2013, 4:00:52 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
rebase_source:
a477a2917afd83611388f33fb48d991ec7d719dc
Message:

Support other interesting keys, too

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/tests/test_yamlish.py

    r136 r137  
    9999        })
    100100
     101    def test_dict_keys(self):
     102        self.roundtrip({
     103            True: 'true',
     104            False: [],
     105            None: {},
     106            0.7: -0.7,
     107        })
     108
    101109    def test_quoted(self):
    102110        # a literal true is True, but 'true' is a string
  • nagslang/yamlish.py

    r136 r137  
    6565        output = []
    6666        for k, v in sorted(data.iteritems()):
    67             output.append('%s%s:' % (' ' * indent, k))
     67            output.append('%s%s:' % (' ' * indent, self._dump_inline(k)))
    6868            if self._inlineable(v):
    6969                output[-1] += ' ' + self._dump_inline(v)
Note: See TracChangeset for help on using the changeset viewer.