python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / misc / drivers / xboxdrv / xboxdrvctl-py3.patch
blob71d8762cb9ca520629eef7c684e802163e90dce1
1 --- a/xboxdrvctl 2021-06-21 19:39:51.000000000 -0400
2 +++ b/xboxdrvctl 19:43:27.467984928 -0400
3 @@ -1,4 +1,4 @@
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>
9 @@ -37,23 +37,23 @@
10 help="print controller status")
12 group.add_option("-s", "--slot", metavar="SLOT", type="int",
13 - dest="slot",
14 + dest="slot",
15 help="use slot SLOT for actions")
17 group.add_option("-l", "--led", metavar="NUM", type="int",
18 - dest="led",
19 + dest="led",
20 help="set LED")
22 -group.add_option("-r", "--rumble", metavar="L:R",
23 - dest="rumble",
24 +group.add_option("-r", "--rumble", metavar="L:R",
25 + dest="rumble",
26 help="print controller status")
28 group.add_option("-c", "--config", metavar="NUM", type="int",
29 - dest="config",
30 + dest="config",
31 help="switches to controller configuration NUM")
33 group.add_option("--shutdown", action="store_true",
34 - dest="shutdown",
35 + dest="shutdown",
36 help="shuts down the daemon")
38 parser.add_option_group(group)
39 @@ -69,9 +69,9 @@
40 try:
41 bus.get_object("org.seul.Xboxdrv", '/org/seul/Xboxdrv/Daemon')
42 except dbus.exceptions.DBusException:
43 - bus = dbus.SystemBus()
44 + bus = dbus.SystemBus()
45 else:
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'")
48 exit()
50 if options.status:
51 @@ -82,19 +82,19 @@
52 daemon.Shutdown()
53 else:
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")
57 exit()
58 else:
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)
66 if options.rumble:
67 m = re.match('^(\d+):(\d+)$', options.rumble)
68 if not m:
69 - print "Error: invalid argument to --rumble"
70 + print("Error: invalid argument to --rumble")
71 exit()
72 else:
73 left = int(m.group(1))