Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions source/brailleInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#: @type: int
UNICODE_BRAILLE_START = 0x2800
#: The Unicode braille character to use when masking cells in protected fields.
#: @type: unicode
#: @type: str
UNICODE_BRAILLE_PROTECTED = u"⣿" # All dots down

#: The singleton BrailleInputHandler instance.
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self):
#: or were translated but did not produce any text.
#: This is used to show these cells to the user while they're entering braille.
#: This is a string of Unicode braille.
#: @type: unicode
#: @type: str
self.untranslatedBraille = ""
#: The position in L{brailleBuffer} where untranslated braille begins.
self.untranslatedStart = 0
Expand Down Expand Up @@ -126,7 +126,7 @@ def _translate(self, endWord):
self.bufferText = u""
oldTextLen = len(self.bufferText)
pos = self.untranslatedStart + self.untranslatedCursorPos
data = u"".join([unichr(cell | LOUIS_DOTS_IO_START) for cell in self.bufferBraille[:pos]])
data = u"".join([chr(cell | LOUIS_DOTS_IO_START) for cell in self.bufferBraille[:pos]])
mode = louis.dotsIO | louis.noUndefinedDots
if (not self.currentFocusIsTextObj or self.currentModifiers) and self._table.contracted:
mode |= louis.partialTrans
Expand Down Expand Up @@ -175,10 +175,10 @@ def _translate(self, endWord):
def _translateForReportContractedCell(self, pos):
"""Translate text for current input as required by L{_reportContractedCell}.
@return: The previous translated text.
@rtype: unicode
@rtype: str
"""
cells = self.bufferBraille[:pos + 1]
data = u"".join([unichr(cell | LOUIS_DOTS_IO_START) for cell in cells])
data = u"".join([chr(cell | LOUIS_DOTS_IO_START) for cell in cells])
oldText = self.bufferText
text = louis.backTranslate(
[os.path.join(brailleTables.TABLES_DIR, self._table.fileName),
Expand Down Expand Up @@ -293,7 +293,7 @@ def _updateUntranslated(self):
if api.isTypingProtected():
self.untranslatedBraille = UNICODE_BRAILLE_PROTECTED * (len(self.bufferBraille) - self.untranslatedStart)
else:
self.untranslatedBraille = "".join([unichr(UNICODE_BRAILLE_START + dots) for dots in self.bufferBraille[self.untranslatedStart:]])
self.untranslatedBraille = "".join([chr(UNICODE_BRAILLE_START + dots) for dots in self.bufferBraille[self.untranslatedStart:]])

def updateDisplay(self):
"""Update the braille display to reflect untranslated input.
Expand Down Expand Up @@ -385,7 +385,7 @@ def emulateKey(self, key, withModifiers=True):
def sendChars(self, chars):
"""Sends the provided unicode characters to the system.
@param chars: The characters to send to the system.
@type chars: unicode
@type chars: str
"""
inputs = []
for ch in chars:
Expand Down