Merge pull request #4 from benoit-pierre/use_pyusb_libusb1_backend
use `pyusb_libusb1_backend` on Linux/macOS
This commit is contained in:
commit
b2c801c2db
2 changed files with 7 additions and 2 deletions
|
|
@ -488,6 +488,8 @@ else:
|
||||||
|
|
||||||
from usb import core, util
|
from usb import core, util
|
||||||
|
|
||||||
|
from pyusb_libusb1_backend import get_pyusb_backend
|
||||||
|
|
||||||
class StenographMachine(AbstractStenographMachine):
|
class StenographMachine(AbstractStenographMachine):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -503,8 +505,10 @@ else:
|
||||||
if self._connected:
|
if self._connected:
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
||||||
|
backend = get_pyusb_backend()
|
||||||
|
|
||||||
# Find the device by the vendor ID.
|
# 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
|
if not usb_device: # Device not found
|
||||||
return self._connected
|
return self._connected
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ tests_require =
|
||||||
install_requires =
|
install_requires =
|
||||||
plover>=4.0.0.dev5
|
plover>=4.0.0.dev5
|
||||||
more_itertools
|
more_itertools
|
||||||
pyusb>=1.0.0;platform_system!="Windows"
|
pyusb>=1.0.0; platform_system != "Windows"
|
||||||
|
pyusb_libusb1_backend; platform_system != "Windows"
|
||||||
py_modules =
|
py_modules =
|
||||||
plover_stenograph_usb
|
plover_stenograph_usb
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue