From: Lumir Balhar Date: Tue, 8 Aug 2017 08:56:17 +0000 (+0200) Subject: python: scripting: Port ntstatus and werror generators to Python 3 compatible form. X-Git-Tag: tdb-1.3.15~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=051a3ff6eb7dad08202b13aadbc6829370cc3f4b;p=thirdparty%2Fsamba.git python: scripting: Port ntstatus and werror generators to Python 3 compatible form. Signed-off-by: Lumir Balhar Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlet --- diff --git a/source4/scripting/bin/gen_error_common.py b/source4/scripting/bin/gen_error_common.py index a55baeaf788..ab86c4d2842 100644 --- a/source4/scripting/bin/gen_error_common.py +++ b/source4/scripting/bin/gen_error_common.py @@ -77,6 +77,6 @@ def parseErrorDescriptions( file_contents, isWinError, transformErrorFunction ): else: err.err_string = err.err_string + " " + desc count = count + 1 - print "parsed %d lines generated %d error definitions"%(count,len(errors)) + print("parsed %d lines generated %d error definitions"%(count,len(errors))) return errors diff --git a/source4/scripting/bin/gen_ntstatus.py b/source4/scripting/bin/gen_ntstatus.py index 9592ab22bfd..3267c3295ad 100755 --- a/source4/scripting/bin/gen_ntstatus.py +++ b/source4/scripting/bin/gen_ntstatus.py @@ -122,7 +122,7 @@ def main (): gen_sourcefile_name = sys.argv[3] gen_pythonfile_name = sys.argv[4] else: - print "usage: %s winerrorfile headerfile sourcefile pythonfile" % (sys.argv[0]) + print("usage: %s winerrorfile headerfile sourcefile pythonfile" % (sys.argv[0])) sys.exit() # read in the data @@ -130,15 +130,15 @@ def main (): errors = parseErrorDescriptions(file_contents, False, transformErrorName) - print "writing new header file: %s" % gen_headerfile_name + print("writing new header file: %s" % gen_headerfile_name) out_file = open(gen_headerfile_name, "w") generateHeaderFile(out_file, errors) out_file.close() - print "writing new source file: %s" % gen_sourcefile_name + print("writing new source file: %s" % gen_sourcefile_name) out_file = open(gen_sourcefile_name, "w") generateSourceFile(out_file, errors) out_file.close() - print "writing new python file: %s" % gen_pythonfile_name + print("writing new python file: %s" % gen_pythonfile_name) out_file = open(gen_pythonfile_name, "w") generatePythonFile(out_file, errors) out_file.close() diff --git a/source4/scripting/bin/gen_werror.py b/source4/scripting/bin/gen_werror.py old mode 100644 new mode 100755 index 7210d3fa78c..9a545726ba5 --- a/source4/scripting/bin/gen_werror.py +++ b/source4/scripting/bin/gen_werror.py @@ -124,22 +124,22 @@ def main(): gen_sourcefile_name = sys.argv[3] gen_pythonfile_name = sys.argv[4] else: - print "usage: %s winerrorfile headerfile sourcefile pythonfile" % sys.argv[0] + print("usage: %s winerrorfile headerfile sourcefile pythonfile" % sys.argv[0]) sys.exit() input_file = open(input_file_name, "r") errors = parseErrorDescriptions(input_file, True, transformErrorName) input_file.close() - print "writing new header file: %s" % gen_headerfile_name + print("writing new header file: %s" % gen_headerfile_name) out_file = open(gen_headerfile_name, "w") generateHeaderFile(out_file, errors) out_file.close() - print "writing new source file: %s" % gen_sourcefile_name + print("writing new source file: %s" % gen_sourcefile_name) out_file = open(gen_sourcefile_name, "w") generateSourceFile(out_file, errors) out_file.close() - print "writing new python file: %s" % gen_pythonfile_name + print("writing new python file: %s" % gen_pythonfile_name) out_file = open(gen_pythonfile_name, "w") generatePythonFile(out_file, errors) out_file.close()