Merge pull request #4 from benoit-pierre/use_pyusb_libusb1_backend

use `pyusb_libusb1_backend` on Linux/macOS
This commit is contained in:
Ted Morin 2021-10-26 15:49:30 -04:00 committed by GitHub
commit b2c801c2db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -488,6 +488,8 @@ else:
from usb import core, util
from pyusb_libusb1_backend import get_pyusb_backend
class StenographMachine(AbstractStenographMachine):
def __init__(self):
@ -503,8 +505,10 @@ else:
if self._connected:
self.disconnect()
backend = get_pyusb_backend()
# Find the device by the vendor ID.
usb_device = core.find(idVendor=VENDOR_ID)
usb_device = core.find(backend=backend, idVendor=VENDOR_ID)
if not usb_device: # Device not found
return self._connected

View file

@ -26,7 +26,8 @@ tests_require =
install_requires =
plover>=4.0.0.dev5
more_itertools
pyusb>=1.0.0;platform_system!="Windows"
pyusb>=1.0.0; platform_system != "Windows"
pyusb_libusb1_backend; platform_system != "Windows"
py_modules =
plover_stenograph_usb