[gimp-help/wip/wormnest/python3-migration: 45/45] tools: also update docbook.py to python3.




commit 24cc608d963a3f949c7b5ad3ea052e2dc5c3105c
Author: Jacob Boerema <jgboerema gmail com>
Date:   Mon Mar 29 17:55:35 2021 -0400

    tools: also update docbook.py to python3.

 tools/xml2po/modes/docbook.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tools/xml2po/modes/docbook.py b/tools/xml2po/modes/docbook.py
index 5658ffc1a..ed395080e 100644
--- a/tools/xml2po/modes/docbook.py
+++ b/tools/xml2po/modes/docbook.py
@@ -95,7 +95,7 @@ class docbookXmlMode(basicXmlMode):
             ret = self._find_articleinfo(child)
             if ret:
                 return ret
-            child = child.__next__
+            child = child.next
         return None
 
     def _find_lastcopyright(self, node):
@@ -140,7 +140,7 @@ class docbookXmlMode(basicXmlMode):
             child = node.children
             while child:
                 self._output_images(child,msg)
-                child = child.__next__
+                child = child.next
 
 
     def preProcessXml(self, doc, msg):
@@ -157,7 +157,7 @@ class docbookXmlMode(basicXmlMode):
         root = doc.getRootElement()
         # DocBook documents can be something other than article, handle that as well in the future
         while root and root.name != 'article' and root.name != 'book':
-            root = root.__next__
+            root = root.next
         if root and (root.name == 'article' or root.name == 'book'):
             root.setProp('lang', language)
         else:
@@ -184,7 +184,7 @@ class docbookXmlMode(basicXmlMode):
                     else:
                         ai.addChild(copy)
                     if match.group(3):
-                        copy.newChild(None, "year", match.group(3).encode('utf-8'))
+                        copy.newChild(None, "year", match.group(3))
                     if match.group(1) and match.group(2):
                         holder = match.group(1)+"(%s)" % match.group(2)
                     elif match.group(1):
@@ -193,7 +193,7 @@ class docbookXmlMode(basicXmlMode):
                         holder = match.group(2)
                     else:
                         holder = "???"
-                    copy.newChild(None, "holder", holder.encode('utf-8'))
+                    copy.newChild(None, "holder", holder)
 
 # Perform some tests when ran standalone
 if __name__ == '__main__':


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]