[libxml2] Port build_glob.py to Python 3



commit b071d74b1a4d6f0829e2b96f194f529c2d589f76
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Thu Aug 18 22:17:35 2022 +0200

    Port build_glob.py to Python 3

 build_glob.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/build_glob.py b/build_glob.py
index 750fd70e..b666129a 100755
--- a/build_glob.py
+++ b/build_glob.py
@@ -9,7 +9,6 @@
 #       See Copyright for the status of this software.
 #       Gary Pennington sun com
 ###
-import os, string
 
 class globvar:
     def __init__(self, type, name):
@@ -41,8 +40,8 @@ if __name__ == "__main__":
     for line in global_hdr:
         line = striplinesep(line)
         if line == " * Automatically generated by build_glob.py.":
-           break
-       writeline(global_functions_hdr, line)
+            break
+        writeline(global_functions_hdr, line)
 
     writeline(global_functions_hdr, " * Automatically generated by build_glob.py.")
     writeline(global_functions_hdr, " * Do not modify the previous line.")
@@ -52,8 +51,8 @@ if __name__ == "__main__":
     for line in global_code:
         line = striplinesep(line)
         if line == " * Automatically generated by build_glob.py.":
-           break
-       writeline(global_functions_impl, line)
+            break
+        writeline(global_functions_impl, line)
 
     writeline(global_functions_impl, " * Automatically generated by build_glob.py.")
     writeline(global_functions_impl, " * Do not modify the previous line.")
@@ -65,10 +64,10 @@ if __name__ == "__main__":
         if line[0]=='#':
             continue
         line = striplinesep(line)
-        fields = string.split(line, ",")
+        fields = line.split(",")
         # Update the header file
         writeline(global_functions_hdr)
-        global_functions_hdr.write("XMLPUBFUN "+fields[0]+" * XMLCALL ")
+        global_functions_hdr.write("XMLPUBFUN "+fields[0]+" * XMLCALL\n\t")
         if fields[2]:
             global_functions_hdr.write("(*")
         global_functions_hdr.write("__"+fields[1]+"(void)")


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