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 9203874b59c43a3f
parent 9202 01bb8e3ba14f
child 9204 b331795924d3
Updated gamecontroller database sorting script to work with Python 3.
src/joystick/sort_controllers.py
     1.1 --- a/src/joystick/sort_controllers.py	Wed Oct 29 20:29:32 2014 +0100
     1.2 +++ b/src/joystick/sort_controllers.py	Wed Oct 29 20:35:21 2014 +0100
     1.3 @@ -30,9 +30,9 @@
     1.4      for entry in sorted(controllers, key=lambda entry: entry[2]):
     1.5          line = "".join(entry) + "\n"
     1.6          if not line.endswith(",\n") and not line.endswith("*/\n"):
     1.7 -            print "Warning: '%s' is missing a comma at the end of the line" % (line)
     1.8 +            print("Warning: '%s' is missing a comma at the end of the line" % (line))
     1.9          if (entry[1] in controller_guids):
    1.10 -            print "Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2])
    1.11 +            print("Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2]))
    1.12          controller_guids[entry[1]] = entry
    1.13  
    1.14          output.write(line)
    1.15 @@ -48,7 +48,7 @@
    1.16              write_controllers()
    1.17              output.write(line)
    1.18          elif (line.startswith("#")):
    1.19 -            print "Parsing " + line.strip()
    1.20 +            print("Parsing " + line.strip())
    1.21              write_controllers()
    1.22              output.write(line)
    1.23          else:
    1.24 @@ -60,4 +60,4 @@
    1.25          output.write(line)
    1.26  
    1.27  output.close()
    1.28 -print "Finished writing %s.new" % filename
    1.29 +print("Finished writing %s.new" % filename)