1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-02-06 05:57:39 +03:00

Port build_glob.py to Python 3

This commit is contained in:
Nick Wellnhofer 2022-08-18 22:17:35 +02:00
parent b22b6deba9
commit b071d74b1a

View File

@ -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)")