1 --- a/xboxdrvctl 2021-06-21 19:39:51.000000000 -0400
2 +++ b/xboxdrvctl 19:43:27.467984928 -0400
4 -#!/usr/bin/env python2
5 +#!/usr/bin/env python3
7 ## Xbox360 USB Gamepad Userspace Driver
8 ## Copyright (C) 2011 Ingo Ruhnke <grumbel@gmail.com>
10 help="print controller status")
12 group.add_option("-s", "--slot", metavar="SLOT", type="int",
15 help="use slot SLOT for actions")
17 group.add_option("-l", "--led", metavar="NUM", type="int",
22 -group.add_option("-r", "--rumble", metavar="L:R",
24 +group.add_option("-r", "--rumble", metavar="L:R",
26 help="print controller status")
28 group.add_option("-c", "--config", metavar="NUM", type="int",
31 help="switches to controller configuration NUM")
33 group.add_option("--shutdown", action="store_true",
36 help="shuts down the daemon")
38 parser.add_option_group(group)
41 bus.get_object("org.seul.Xboxdrv", '/org/seul/Xboxdrv/Daemon')
42 except dbus.exceptions.DBusException:
43 - bus = dbus.SystemBus()
44 + bus = dbus.SystemBus()
46 - print "Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'"
47 + print("Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'")
54 if (options.led or options.rumble or options.config) and options.slot == None:
55 - print "Error: --slot argument required"
56 + print("Error: --slot argument required")
59 if options.slot != None:
60 slot = bus.get_object("org.seul.Xboxdrv", '/org/seul/Xboxdrv/ControllerSlots/%d' % options.slot)
63 if options.led != None:
64 slot.SetLed(options.led)
67 m = re.match('^(\d+):(\d+)$', options.rumble)
69 - print "Error: invalid argument to --rumble"
70 + print("Error: invalid argument to --rumble")
73 left = int(m.group(1))