From 17accd435ee669a962a2166517979e2c9cb44bf3 Mon Sep 17 00:00:00 2001 From: Guido Draheim Date: Sat, 24 Mar 2018 11:40:17 +0100 Subject: [PATCH] and ensure ET.tostring() is a str() in python3 #47 --- docs/dbk2man.py | 7 +++++++ 1 file changed, 7 insertions(+) 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(" ", " ") -- 2.40.0