From 0a9a2fd752b03e1796ed6ce110ee939f0eb773e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 18 Jul 2017 14:00:59 +0200 Subject: Force libusb-1.0 backend --- setup.py | 7 +------ turtetris_master/led_output.py | 0 turtetris_master/usb_input.py | 6 +++++- 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 turtetris_master/led_output.py diff --git a/setup.py b/setup.py index 798eb8f..348f7cf 100755 --- a/setup.py +++ b/setup.py @@ -21,10 +21,5 @@ setup( ], keywords='Turris Tetris', - packages=['turtetris_master'], - entry_points={ - 'console_scripts': [ - 'turtetris-master=turtetris_master:main' - ] - } + packages=['turtetris_master'] ) diff --git a/turtetris_master/led_output.py b/turtetris_master/led_output.py new file mode 100644 index 0000000..e69de29 diff --git a/turtetris_master/usb_input.py b/turtetris_master/usb_input.py index 8864ef9..0bb9d56 100644 --- a/turtetris_master/usb_input.py +++ b/turtetris_master/usb_input.py @@ -1,4 +1,5 @@ import usb.core +import usb.backend.libusb1 import usb.util # Personal Communication Systems, Inc. SNES Gamepad @@ -14,8 +15,11 @@ class Gamepad: def __init__(self, conf=CONF_SNES_GAMEPAD): "Initializes usb subsystem" + backend = usb.backend.libusb1.get_backend(find_library=lambda x: + "/usr/lib/libusb-1.0.so") self.dev = usb.core.find(idVendor=conf['idVendor'], - idProduct=conf['idProduct']) + idProduct=conf['idProduct'], + backend=backend) if self.dev is None: raise ValueError('Device not found') -- cgit v1.2.3