Tools: make parameter generation failure clearer

This commit is contained in:
Peter Barker 2018-03-26 12:35:13 +11:00
parent f8d5fe96d8
commit dca866c98d
4 changed files with 8 additions and 0 deletions

View File

@ -69,6 +69,8 @@ DO NOT EDIT
t += "<table><th>Value</th><th>Meaning</th>\n"
for value in values:
v = value.split(':')
if len(v) != 2:
raise ValueError("Bad value (%s)" % v)
t += "<tr><td>%s</td><td>%s</td></tr>\n" % (v[0], v[1])
t += "</table>\n"
elif field == 'Units':

View File

@ -98,6 +98,8 @@ class MDEmit(Emit):
t += "\n|:---:|:---:|"
for value in values:
v = value.split(':')
if len(v) != 2:
raise ValueError("Bad value (%s)" % v)
t += "\n|%s|%s|" % (v[0], v[1])
else:
t += "\n\n- %s: %s" % (field, param.__dict__[field])

View File

@ -62,6 +62,8 @@ class WikiEmit(Emit):
t += "|| *Value* || *Meaning* ||\n"
for value in values:
v = value.split(':')
if len(v) != 2:
raise ValueError("Bad value (%s)" % v)
t += "|| " + v[0] + " || " + self.camelcase_escape(v[1]) + " ||\n"
elif field == 'Units':
abreviated_units = param.__dict__[field]

View File

@ -57,6 +57,8 @@ class XmlEmit(Emit):
values = (param.__dict__[field]).split(',')
for value in values:
v = value.split(':')
if len(v) != 2:
raise ValueError("Bad value (%s)" % v)
t += '''<value code=%s>%s</value>\n''' % (quoteattr(v[0]), escape(v[1])) # i.e. numeric value, string label
t += "</values>\n"