Upgrade to bitstring 4.0.1

This commit is contained in:
Charlotte 🦝 Delenk 2023-01-04 11:59:57 +01:00
parent 015dd7f97e
commit 45d339b4c8
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
2 changed files with 6 additions and 6 deletions

View file

@ -14,7 +14,7 @@ from plover.engine import StenoEngine
from plover.machine.base import ThreadedStenotypeBase
from plover import log
from bitstring import BitString
from bitstring import BitArray
import hid
import platform
import threading
@ -88,11 +88,11 @@ class HidMachine(ThreadedStenotypeBase):
self._params = params
self._hid = None
def _parse(self, report: bytes) -> Optional[BitString]:
def _parse(self, report: bytes) -> Optional[BitArray]:
if len(report) != SIMPLE_REPORT_LEN:
raise InvalidReport()
if report[:3] == b"STN":
return BitString(bytes=report[3:13])
return BitArray(bytes=report[3:13])
elif report[:3] == b"UNI":
try:
s = report[3:].decode("UTF-8").strip('\0')
@ -110,7 +110,7 @@ class HidMachine(ThreadedStenotypeBase):
def run(self):
self._ready()
keystate = BitString(N_LEVERS)
keystate = BitArray(N_LEVERS)
thread = threading.Thread(target=self._ping_thread)
thread.start()
while not self.finished.wait(0):
@ -134,7 +134,7 @@ class HidMachine(ThreadedStenotypeBase):
)
if steno_actions:
self._notify(steno_actions)
keystate = BitString(N_LEVERS)
keystate = BitArray(N_LEVERS)
def start_capture(self):
self.finished.clear()

View file

@ -9,7 +9,7 @@ setup_requires =
install_requires =
plover>=4.0.0.dev10
hid>=1.0.4
bitstring>=3.1.9
bitstring>=4.0.1
py_modules =
plover_machine_hid