Skip to content

Commit fa13581

Browse files
authored
Merge 5c411c2 into 364d029
2 parents 364d029 + 5c411c2 commit fa13581

4 files changed

Lines changed: 23 additions & 18 deletions

File tree

source/bdDetect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,10 @@ def initialize():
690690
"VID_C251&PID_1132", # Reserved
691691
})
692692
addUsbDevices("eurobraille", KEY_SERIAL, {
693-
"VID_28AC&PID_0012", # b.note
694-
"VID_28AC&PID_0013", # b.note 2
695-
"VID_28AC&PID_0020", # b.book internal
696-
"VID_28AC&PID_0021", # b.book external
693+
"VID_28AC&PID_0012", # bnote
694+
"VID_28AC&PID_0013", # bnote 2
695+
"VID_28AC&PID_0020", # bbook internal
696+
"VID_28AC&PID_0021", # bbook external
697697
})
698698

699699
addBluetoothDevices("eurobraille", lambda m: m.id.startswith("Esys"))

source/brailleDisplayDrivers/eurobraille/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
0x0f: "Esytime 32 standard",
122122
0x10: "Esytime evo 32",
123123
0x11: "Esytime evo 32 standard",
124-
0x12: "b.note",
125-
0x13: "b.note 2",
126-
0x14: "b.book",
127-
0x15: "b.book 2"
124+
0x12: "bnote",
125+
0x13: "bnote 2",
126+
0x14: "bbook",
127+
0x15: "bbook 2"
128128
}

source/brailleDisplayDrivers/eurobraille/driver.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def getManualPorts(cls):
4848
return braille.getSerialPorts()
4949

5050
def __init__(self, port="Auto"):
51-
super(BrailleDisplayDriver, self).__init__()
51+
super().__init__()
5252
self.numCells = 0
5353
self.deviceType = None
5454
self._deviceData = {}
@@ -101,7 +101,7 @@ def __init__(self, port="Auto"):
101101
# A display responded.
102102
log.info("Found {device} connected via {type} ({port})".format(
103103
device=self.deviceType, type=portType, port=port))
104-
if self.deviceType.startswith(("b.note", "b.book")):
104+
if self.deviceType.startswith(("bnote", "bbook")):
105105
# send identifier to bnote / bbook with current COM port
106106
comportNumber = f'{int(re.match(".*?([0-9]+)$", port).group(1)):02d}'
107107
identifier = f"NVDA/{comportNumber}".encode()
@@ -118,10 +118,10 @@ def __init__(self, port="Auto"):
118118

119119
def terminate(self):
120120
try:
121-
if self.deviceType.startswith(("b.note", "b.book")):
121+
if self.deviceType.startswith(("bnote", "bbook")):
122122
# reset identifier to bnote / bbook with current COM port
123123
self._sendPacket(constants.EB_SYSTEM, constants.EB_CONNECTION_NAME, b'')
124-
super(BrailleDisplayDriver, self).terminate()
124+
super().terminate()
125125
finally:
126126
# We must sleep before closing the port as not doing this can leave
127127
# the display in a bad state where it can not be re-initialized.
@@ -190,7 +190,7 @@ def _onReceive(self, data: bytes):
190190

191191
def _handleAck(self, frame: int):
192192
try:
193-
super(BrailleDisplayDriver, self)._handleAck()
193+
super()._handleAck()
194194
except NotImplementedError:
195195
log.debugWarning(f"Received ACK for frame {frame} while ACK handling is disabled")
196196
else:
@@ -325,7 +325,7 @@ def _set_hidKeyboardInput(self, state: bool):
325325

326326
scriptCategory = SCRCAT_BRAILLE
327327

328-
def script_toggleHidKeyboardInput(self, gesture):
328+
def script_toggleHidKeyboardInput(self, gesture: inputCore.InputGesture):
329329
def announceUnavailableMessage():
330330
# Translators: Message when HID keyboard simulation is unavailable.
331331
ui.message(_("HID keyboard input simulation is unavailable."))

source/brailleDisplayDrivers/eurobraille/gestures.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33
# See the file COPYING for more details.
44
# Copyright (C) 2017-2023 NV Access Limited, Babbage B.V., Eurobraille, Cyrille Bougot
55

6+
from typing import TYPE_CHECKING
67
import braille
78
import brailleInput
89
import inputCore
910
from . import constants
1011

12+
if TYPE_CHECKING:
13+
from .driver import BrailleDisplayDriver
14+
15+
1116
GestureMapEntries = {
1217
"globalCommands.GlobalCommands": {
1318
"braille_routeTo": ("br(eurobraille):routing",),
1419
"braille_reportFormatting": ("br(eurobraille):doubleRouting",),
1520
"braille_scrollBack": (
16-
"br(eurobraille.b.note):joystick1Left",
21+
"br(eurobraille.bnote):joystick1Left",
1722
"br(eurobraille):switch1Left",
1823
"br(eurobraille):l1",
1924
),
2025
"braille_scrollForward": (
21-
"br(eurobraille.b.note):joystick1Right",
26+
"br(eurobraille.bnote):joystick1Right",
2227
"br(eurobraille):switch1Right",
2328
"br(eurobraille):l8",
2429
),
@@ -151,8 +156,8 @@ class InputGesture(braille.BrailleDisplayGesture, brailleInput.BrailleInputGestu
151156

152157
source = constants.name
153158

154-
def __init__(self, display):
155-
super(InputGesture, self).__init__()
159+
def __init__(self, display: "BrailleDisplayDriver"):
160+
super().__init__()
156161
self.model = display.deviceType.lower().split(" ")[0]
157162
keysDown = dict(display.keysDown)
158163

0 commit comments

Comments
 (0)