diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-05-31 21:10:43 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-19 16:28:05 -0400 |
commit | ec2ed2fb324d92573418afcc17365c83373023ec (patch) | |
tree | f166bc01eb1c33cf73144fb487629082b5aeb508 /src/pdmgen.py | |
parent | babf3b78deb58a2f40e405713f5ceb1485457529 (diff) | |
download | phosphor-dbus-monitor-ec2ed2fb324d92573418afcc17365c83373023ec.tar.gz phosphor-dbus-monitor-ec2ed2fb324d92573418afcc17365c83373023ec.zip |
Fix bool and string templates/rendering
Fix a number of bugs related to rendering and instantiation of
string and bool templates.
Change-Id: Ic75842b4016f4d96bf5850f9c4ad778d82e075ed
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'src/pdmgen.py')
-rwxr-xr-x | src/pdmgen.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/pdmgen.py b/src/pdmgen.py index d878500..ac2b8e0 100755 --- a/src/pdmgen.py +++ b/src/pdmgen.py @@ -101,11 +101,9 @@ class Literal(object): '''Decorate an argument with a literal operator.''' integer_types = [ - 'int8', 'int16', 'int32', 'int64', - 'uint8', 'uint16', 'uint32', 'uint64' @@ -122,6 +120,8 @@ class Literal(object): if self.type in self.integer_types: return Cast('static', '{0}_t'.format(self.type))(arg) + elif self.type == 'byte': + return Cast('static', 'uint8_t'.format(self.type))(arg) if self.type == 'string': return '{0}s'.format(arg) @@ -396,9 +396,10 @@ class GroupOfProperties(ImplicitGroup): '''Property group config file directive.''' def __init__(self, *a, **kw): + self.type = kw.pop('type') self.datatype = sdbusplus.property.Property( name=kw.get('name'), - type=kw.pop('type')).cppTypeName + type=self.type).cppTypeName super(GroupOfProperties, self).__init__(**kw) @@ -507,6 +508,7 @@ class HasPropertyIndex(ConfigEntry): self.properties, config=self.configfile) self.datatype = objs['propertygroup'][self.properties].datatype + self.type = objs['propertygroup'][self.properties].type super(HasPropertyIndex, self).setup(objs) @@ -626,6 +628,14 @@ class CountCondition(Condition, Renderer): self.bound = kw.pop('bound') super(CountCondition, self).__init__(**kw) + def setup(self, objs): + '''Resolve type.''' + + super(CountCondition, self).setup(objs) + self.bound = TrivialArgument( + type=self.type, + value=self.bound) + def construct(self, loader, indent): return self.render( loader, |