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-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3349f3bf9533a6df47d05f2664db03d69fc3e985;p=openvswitch 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 53292b33..8f725d79 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)