pimgen: Un-capitalize booleans
The YAML parser capitalizes true and false. Undo that in
boolean context.
Change-Id: Ib11719ecb77de87991c1add776adefa4e879b786
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/pimgen.py b/pimgen.py
index deaeb59..0223c57 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -74,6 +74,13 @@
return '::'.join(self.namespace + [self.name])
+class FixBool(object):
+ '''Un-capitalize booleans.'''
+
+ def __call__(self, arg):
+ return '{0}'.format(arg.lower())
+
+
class Quote(object):
'''Decorate an argument by quoting it.'''
@@ -134,6 +141,8 @@
self.decorators = kw.pop('decorators', [])
if kw.get('type', None) == 'string':
self.decorators.insert(0, Quote())
+ if kw.get('type', None) == 'boolean':
+ self.decorators.insert(0, FixBool())
super(TrivialArgument, self).__init__(**kw)