tweak char and line utils
This commit is contained in:
parent
d8442c8f04
commit
c8e23b8d78
@ -24,6 +24,8 @@ class outputManager():
|
|||||||
self.env['runtime']['settingsManager'].shutdownDriver('brailleDriver')
|
self.env['runtime']['settingsManager'].shutdownDriver('brailleDriver')
|
||||||
|
|
||||||
def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False):
|
def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False):
|
||||||
|
if text == '':
|
||||||
|
return
|
||||||
self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO)
|
self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO)
|
||||||
if self.playSoundIcon(soundIcon, interrupt):
|
if self.playSoundIcon(soundIcon, interrupt):
|
||||||
self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO)
|
self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO)
|
||||||
|
@ -15,7 +15,7 @@ def getPrevChar(currX,currY, currText):
|
|||||||
x = currX
|
x = currX
|
||||||
y = currY
|
y = currY
|
||||||
if x - 1 < 0:
|
if x - 1 < 0:
|
||||||
if y - 1 > 0:
|
if y - 1 >= 0:
|
||||||
y -= 1
|
y -= 1
|
||||||
x = len(wrappedLines[y]) - 1
|
x = len(wrappedLines[y]) - 1
|
||||||
lineBreak = True
|
lineBreak = True
|
||||||
@ -24,6 +24,8 @@ def getPrevChar(currX,currY, currText):
|
|||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
else:
|
else:
|
||||||
x -= 1
|
x -= 1
|
||||||
|
currChar = ''
|
||||||
|
if not endOfScreen:
|
||||||
currChar = wrappedLines[y][x]
|
currChar = wrappedLines[y][x]
|
||||||
return x, y, currChar, endOfScreen, lineBreak
|
return x, y, currChar, endOfScreen, lineBreak
|
||||||
|
|
||||||
@ -44,6 +46,8 @@ def getUpChar(currX,currY, currText):
|
|||||||
currY = 0
|
currY = 0
|
||||||
else:
|
else:
|
||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
|
currChar = ''
|
||||||
|
if not endOfScreen:
|
||||||
currChar = wrappedLines[currY][currX]
|
currChar = wrappedLines[currY][currX]
|
||||||
return currX, currY, currChar, endOfScreen
|
return currX, currY, currChar, endOfScreen
|
||||||
|
|
||||||
@ -57,6 +61,8 @@ def getDownChar(currX,currY, currText):
|
|||||||
currY = len(wrappedLines) -1
|
currY = len(wrappedLines) -1
|
||||||
else:
|
else:
|
||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
|
currChar = ''
|
||||||
|
if not endOfScreen:
|
||||||
currChar = wrappedLines[currY][currX]
|
currChar = wrappedLines[currY][currX]
|
||||||
return currX, currY, currChar, endOfScreen
|
return currX, currY, currChar, endOfScreen
|
||||||
|
|
||||||
@ -89,6 +95,8 @@ def getNextChar(currX,currY, currText):
|
|||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
else:
|
else:
|
||||||
x += 1
|
x += 1
|
||||||
|
currChar = ''
|
||||||
|
if not endOfScreen:
|
||||||
currChar = wrappedLines[y][x]
|
currChar = wrappedLines[y][x]
|
||||||
return x, y, currChar, endOfScreen, lineBreak
|
return x, y, currChar, endOfScreen, lineBreak
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ def getPrevLine(currX,currY, currText):
|
|||||||
else:
|
else:
|
||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
x = 0
|
x = 0
|
||||||
|
currLine = ''
|
||||||
|
if not endOfScreen:
|
||||||
currLine = wrappedLines[y]
|
currLine = wrappedLines[y]
|
||||||
return x, y, currLine, endOfScreen
|
return x, y, currLine, endOfScreen
|
||||||
|
|
||||||
@ -44,5 +46,7 @@ def getNextLine(currX,currY, currText):
|
|||||||
else:
|
else:
|
||||||
endOfScreen = True
|
endOfScreen = True
|
||||||
x = 0
|
x = 0
|
||||||
|
currLine = ''
|
||||||
|
if not endOfScreen:
|
||||||
currLine = wrappedLines[y]
|
currLine = wrappedLines[y]
|
||||||
return x, y, currLine, endOfScreen
|
return x, y, currLine, endOfScreen
|
||||||
|
Loading…
Reference in New Issue
Block a user