python: scripting: Port ntstatus and werror generators to Python 3 compatible form.
authorLumir Balhar <lbalhar@redhat.com>
Tue, 8 Aug 2017 08:56:17 +0000 (10:56 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 22 Aug 2017 11:47:15 +0000 (13:47 +0200)
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
source4/scripting/bin/gen_error_common.py
source4/scripting/bin/gen_ntstatus.py
source4/scripting/bin/gen_werror.py [changed mode: 0644->0755]

index a55baeaf7880510c8f96785924ca4379352b7ddb..ab86c4d28421b5751cdcf86bec2faa490050f797 100644 (file)
@@ -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
 
index 9592ab22bfd5e0428d54451c0bafe8ee3e8347dd..3267c3295adf100ec08a8f3fb511e830862a876b 100755 (executable)
@@ -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()
old mode 100644 (file)
new mode 100755 (executable)
index 7210d3f..9a54572
@@ -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()