From: Guido Draheim Date: Sat, 24 Mar 2018 10:40:17 +0000 (+0100) Subject: and ensure ET.tostring() is a str() in python3 #47 X-Git-Tag: v0.13.70~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17accd435ee669a962a2166517979e2c9cb44bf3;p=zziplib and ensure ET.tostring() is a str() in python3 #47 --- diff --git a/docs/dbk2man.py b/docs/dbk2man.py index 59a4b5f..f0b810c 100755 --- a/docs/dbk2man.py +++ b/docs/dbk2man.py @@ -16,16 +16,19 @@ import xml.etree.ElementTree as ET logg = logging.getLogger("dbk2man") def esc(text): + text = str(text) text = text.replace(".", "\\&.") text = text.replace("-", "\\-") return text def unescape(text): + text = str(text) text = text.replace('<', '<') text = text.replace('>', '>') text = text.replace('"', '"') text = text.replace('&', '&') return text def htm(text): + text = str(text) text = text.replace('&', '&') text = text.replace('<', '<') text = text.replace('>', '>') @@ -173,6 +176,7 @@ def refsynopsisdiv2man(refsynopsisdiv, title = ""): funcs = 0 for funcprototype in funcsynopsis.findall("funcprototype"): item = ET.tostring(funcprototype) + item = str(item) item = item.replace("","") item = item.replace("","") if False: @@ -216,6 +220,7 @@ def refsynopsisdiv2htm(refsynopsisdiv, title = ""): funcs = 0 for funcprototype in funcsynopsis.findall("funcprototype"): item = ET.tostring(funcprototype) + item = str(item) item = item.replace("","") item = item.replace("","") item = item.replace("","") @@ -288,6 +293,7 @@ def refsect2htm(refsect, title = ""): def para2man(para): item = unescape(ET.tostring(para)) + item = str(item) item = item.replace("\n", " ") item = item.replace(" ", " ") item = item.replace(" ", " ") @@ -305,6 +311,7 @@ def para2man(para): def para2htm(para): item = unescape(ET.tostring(para)) + item = str(item) item = item.replace("\n", " ") item = item.replace(" ", " ") item = item.replace(" ", " ")