summaryrefslogtreecommitdiff
path: root/python/build
diff options
context:
space:
mode:
Diffstat (limited to 'python/build')
-rw-r--r--python/build/nroff.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/build/nroff.py b/python/build/nroff.py
index 674fdfea3..58c006c1f 100644
--- a/python/build/nroff.py
+++ b/python/build/nroff.py
@@ -17,6 +17,7 @@ import sys
from ovs.db import error
+
def text_to_nroff(s, font=r'\fR'):
def escape(match):
c = match.group(0)
@@ -56,9 +57,11 @@ def text_to_nroff(s, font=r'\fR'):
s = re.sub('(-[0-9]|--|[-"\'\\\\.])', escape, s)
return s
+
def escape_nroff_literal(s, font=r'\fB'):
return font + r'%s\fR' % text_to_nroff(s, font)
+
def inline_xml_to_nroff(node, font, to_upper=False, newline='\n'):
if node.nodeType == node.TEXT_NODE:
if to_upper:
@@ -99,6 +102,7 @@ def inline_xml_to_nroff(node, font, to_upper=False, newline='\n'):
else:
raise error.Error("unknown node %s in inline xml" % node)
+
def pre_to_nroff(nodes, para, font):
# This puts 'font' at the beginning of each line so that leading and
# trailing whitespace stripping later doesn't removed leading spaces
@@ -168,6 +172,7 @@ def diagram_header_to_nroff(header_node):
text_s += "\n"
return pic_s, text_s
+
def diagram_to_nroff(nodes, para):
pic_s = ''
text_s = ''
@@ -210,6 +215,7 @@ fillval = .2
.RE
\\}"""
+
def block_xml_to_nroff(nodes, para='.PP'):
s = ''
for node in nodes: