]> granicus.if.org Git - zziplib/commitdiff
and ensure ET.tostring() is a str() in python3 #47
authorGuido Draheim <guidod@gmx.de>
Sat, 24 Mar 2018 10:40:17 +0000 (11:40 +0100)
committerGuido Draheim <guidod@gmx.de>
Sat, 24 Mar 2018 10:40:17 +0000 (11:40 +0100)
docs/dbk2man.py

index 59a4b5f96593248ebff91358a00165b7f9dcdfc3..f0b810c540e3d9df800943a328edebb0a58ea966 100755 (executable)
@@ -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('&lt;', '<')
     text = text.replace('&gt;', '>')
     text = text.replace('&quot;', '"')
     text = text.replace('&amp;', '&')
     return text
 def htm(text):
+    text = str(text)
     text = text.replace('&', '&amp;')
     text = text.replace('<', '&lt;')
     text = text.replace('>', '&gt;')
@@ -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("<funcprototype>","")
             item = item.replace("</funcprototype>","")
             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("<funcprototype>","")
             item = item.replace("</funcprototype>","")
             item = item.replace("<funcdef>","")
@@ -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("  ", " ")