diff options
author | Kevron Rees <kevron.m.rees@intel.com> | 2015-01-06 11:01:12 -0800 |
---|---|---|
committer | Kevron Rees <kevron.m.rees@intel.com> | 2015-01-06 11:01:12 -0800 |
commit | 8a78f74fd42fb46f97b1c3a414f0d6e47985ff57 (patch) | |
tree | d0df98b47420b7dc682d34cf4161e25d05ef8501 | |
parent | 4d43929911190385dc30dce1c3929c70f8ffbb96 (diff) | |
download | automotive-message-broker-8a78f74fd42fb46f97b1c3a414f0d6e47985ff57.tar.gz |
[tools] - genmapping documentation improvement
-rwxr-xr-x | tools/genmapping.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/genmapping.py b/tools/genmapping.py index 143a67fc..136f9db7 100755 --- a/tools/genmapping.py +++ b/tools/genmapping.py @@ -17,13 +17,22 @@ interfaces = [] class Member: ambName = "" memberName = "" - + interfaceName = "" + def __init__(self, ifaceName): + self.interfaceName = ifaceName def __repr__(self): return "Member" def toString(self): return "{" + self.ambName + " => " + self.memberName + "}" def toIdl(self): - return ' const DOMString ' + self.ambName + ' = "' + self.memberName + '";\n' + idl = [] + idl.append('') + idl.append('\t/*!') + idl.append('\t * \\brief corresponds with DBus property ' + self.memberName + ' for interface org.automotive.' + self.interfaceName) + idl.append('\t * AMB fulfills this member with VehicleProperty::' + self.ambName) + idl.append('\t */') + idl.append('\tconst DOMString ' + self.ambName + ' = "' + self.memberName + '";\n') + return '\n'.join(idl) class Interface: def __init__(self): @@ -37,7 +46,7 @@ class Interface: output += member.toString() + "," return output def toIdl(self): - output = "interface " + self.name + " {\n" + output = "/*! \n * \\brief Corresponds with DBus Interface org.automotive." + self.name + "\n */\ninterface " + self.name + " {\n" for member in self.members: output += member.toIdl() output += "\n};\n" @@ -59,7 +68,7 @@ for input in args.mappingFiles: wantPropertyVariant = 'wantPropertyVariant(' i = line.find(wantPropertyVariant) if i!= -1: - member = Member() + member = Member(interfaces[-1].name) ambNameEnd = line.find(', "')-2 member.ambName = line[i+len(wantPropertyVariant) : i + ambNameEnd].replace("VehicleProperty::", "") memberNameBeg = line.find(', "')+3 @@ -78,7 +87,9 @@ with outputFile: " * \\brief This describes the AMB internal property names to AMB DBus interface property names\n" " * AMB internal property names are designed to be flat variable names (ie, 'ConvertableRoofStatus'). The DBus\n" " * properties however follow the naming scheme defined in the W3C automotive business group vehicle <a href='http://w3c.github.io/automotive-bg/data_spec.html'>data specification</a>\n" - " * The pattern each interface is 'const DOMString AMBProperty = DBusProperty' where 'AMBProperty' is the internal name and 'DBusProperty' is the DBus property name") + " * The pattern each interface is 'const DOMString AMBProperty = DBusProperty' where 'AMBProperty' is the internal name and 'DBusProperty' is the DBus property name.\n" + " *\n" + " * For documentation on the interface and members, please see amb.fidl or the AMB DBus documentation.\n") header += " */\n\n" outputFile.write(header) for iface in interfaces: |