From 3349f3bf9533a6df47d05f2664db03d69fc3e985 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 8 Feb 2012 16:26:57 -0800 Subject: [PATCH] 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 --- ovsdb/ovsdb-doc.in | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) 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) -- 2.43.0