From: Ethan Jackson Date: Thu, 9 Feb 2012 00:26:57 +0000 (-0800) Subject: ovsdb-doc: Support per-element documentation of string sets. X-Git-Tag: sliver-openvswitch-0.1-1~355 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3349f3bf9533a6df47d05f2664db03d69fc3e985;p=sliver-openvswitch.git ovsdb-doc: Support per-element documentation of string sets. A future patch will need to document individual elements in a set of strings. Without this patch the documentation generation code fails trying to figure out what type the value of the map is. Signed-off-by: Ethan Jackson --- diff --git a/ovsdb/ovsdb-doc.in b/ovsdb/ovsdb-doc.in index 53292b33b..8f725d790 100755 --- a/ovsdb/ovsdb-doc.in +++ b/ovsdb/ovsdb-doc.in @@ -185,22 +185,27 @@ def columnGroupToNroff(table, groupXml): type_ = column.type.value nameNroff = "%s : %s" % (name, key) - typeNroff = "optional %s" % column.type.value.toEnglish() - if (column.type.value.type == ovs.db.types.StringType and - type_.type == ovs.db.types.BooleanType): - # This is a little more explicit and helpful than - # "containing a boolean" - typeNroff += r", either \fBtrue\fR or \fBfalse\fR" + + if column.type.value: + typeNroff = "optional %s" % column.type.value.toEnglish() + if (column.type.value.type == ovs.db.types.StringType and + type_.type == ovs.db.types.BooleanType): + # This is a little more explicit and helpful than + # "containing a boolean" + typeNroff += r", either \fBtrue\fR or \fBfalse\fR" + else: + if type_.type != column.type.value.type: + type_english = type_.toEnglish() + if type_english[0] in 'aeiou': + typeNroff += ", containing an %s" % type_english + else: + typeNroff += ", containing a %s" % type_english + constraints = ( + type_.constraintsToEnglish(escapeNroffLiteral)) + if constraints: + typeNroff += ", %s" % constraints else: - if type_.type != column.type.value.type: - type_english = type_.toEnglish() - if type_english[0] in 'aeiou': - typeNroff += ", containing an %s" % type_english - else: - typeNroff += ", containing a %s" % type_english - constraints = type_.constraintsToEnglish(escapeNroffLiteral) - if constraints: - typeNroff += ", %s" % constraints + typeNroff = "none" else: nameNroff = name typeNroff = typeAndConstraintsToNroff(column)