Updated gamecontroller database sorting script to work with Python 3.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 29 Oct 2014 20:35:21 +0100
changeset 9203 874b59c43a3f
parent 9202 01bb8e3ba14f
child 9204 b331795924d3
Updated gamecontroller database sorting script to work with Python 3.
src/joystick/sort_controllers.py
--- a/src/joystick/sort_controllers.py	Wed Oct 29 20:29:32 2014 +0100
+++ b/src/joystick/sort_controllers.py	Wed Oct 29 20:35:21 2014 +0100
@@ -30,9 +30,9 @@
     for entry in sorted(controllers, key=lambda entry: entry[2]):
         line = "".join(entry) + "\n"
         if not line.endswith(",\n") and not line.endswith("*/\n"):
-            print "Warning: '%s' is missing a comma at the end of the line" % (line)
+            print("Warning: '%s' is missing a comma at the end of the line" % (line))
         if (entry[1] in controller_guids):
-            print "Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2])
+            print("Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2]))
         controller_guids[entry[1]] = entry
 
         output.write(line)
@@ -48,7 +48,7 @@
             write_controllers()
             output.write(line)
         elif (line.startswith("#")):
-            print "Parsing " + line.strip()
+            print("Parsing " + line.strip())
             write_controllers()
             output.write(line)
         else:
@@ -60,4 +60,4 @@
         output.write(line)
 
 output.close()
-print "Finished writing %s.new" % filename
+print("Finished writing %s.new" % filename)