#! /usr/bin/python
+# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
from datetime import date
import getopt
import os
argv0 = sys.argv[0]
def typeAndConstraintsToNroff(column):
- type = column.type.toEnglish(escapeNroffLiteral)
- constraints = column.type.constraintsToEnglish(escapeNroffLiteral,
- textToNroff)
+ type = column.type.toEnglish(escape_nroff_literal)
+ constraints = column.type.constraintsToEnglish(escape_nroff_literal,
+ text_to_nroff)
if constraints:
type += ", " + constraints
if column.unique:
introNodes += [node]
summary = []
- intro = blockXmlToNroff(introNodes)
+ intro = block_xml_to_nroff(introNodes)
body = ''
for node in columnNodes:
if node.tagName == 'column':
if column.type.value:
typeNroff = "optional %s" % column.type.value.toEnglish(
- escapeNroffLiteral)
+ escape_nroff_literal)
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
else:
typeNroff += ", containing a %s" % type_english
constraints = (
- type_.constraintsToEnglish(escapeNroffLiteral,
- textToNroff))
+ type_.constraintsToEnglish(escape_nroff_literal,
+ text_to_nroff))
if constraints:
typeNroff += ", %s" % constraints
else:
if not column.mutable:
typeNroff = "immutable %s" % typeNroff
body += '.IP "\\fB%s\\fR: %s"\n' % (nameNroff, typeNroff)
- body += blockXmlToNroff(node.childNodes, '.IP') + "\n"
+ body += block_xml_to_nroff(node.childNodes, '.IP') + "\n"
summary += [('column', nameNroff, typeNroff)]
elif node.tagName == 'group':
title = node.attributes["title"].nodeValue
subSummary, subIntro, subBody = columnGroupToNroff(
table, node, documented_columns)
summary += [('group', title, subSummary)]
- body += '.ST "%s:"\n' % textToNroff(title)
+ body += '.ST "%s:"\n' % text_to_nroff(title)
body += subIntro + subBody
else:
raise error.Error("unknown element %s in <table>" % node.tagName)
.SH NAME
%s \- %s database schema
.PP
-''' % (manpage, schema.version, version, textToNroff(manpage), schema.name)
+''' % (manpage, schema.version, version, text_to_nroff(manpage), schema.name)
tables = ""
introNodes = []
for table in undocumented_tables:
raise error.Error("undocumented table %s" % table)
- s += blockXmlToNroff(introNodes) + "\n"
+ s += block_xml_to_nroff(introNodes) + "\n"
s += r"""
.SH "TABLE SUMMARY"
.TQ 1in
\fB%s\fR
%s
-""" % (name, textToNroff(title))
+""" % (name, text_to_nroff(title))
if erFile:
s += """