# HG changeset patch # User Nick Wellnhofer <wellnhofer@aevum.de> # Date 1660853855 -7200 # Thu Aug 18 22:17:35 2022 +0200 # Node ID ed9ebbd0a8c90e2808389db99e11fc964b23e7a2 # Parent 265a979b5b493db59933a6ec88522baec2e02fa8 Port build_glob.py to Python 3 diff --git a/build_glob.py b/build_glob.py --- 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 @@ 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 @@ 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 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)")