fix word announcement
This commit is contained in:
@ -14,6 +14,7 @@ class command():
|
||||
environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True)
|
||||
else:
|
||||
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -29,9 +29,15 @@ class command():
|
||||
# get the word
|
||||
newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']]
|
||||
x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent)
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||
return environment
|
||||
print('word')
|
||||
# was this a typed word?
|
||||
if environment['screenData']['newDelta'] != '':
|
||||
if not(newContent[environment['screenData']['oldCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['oldCursor']['x']):
|
||||
return environment
|
||||
else:
|
||||
# or just arrow arround?
|
||||
if not(newContent[environment['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != environment['screenData']['newCursor']['x']):
|
||||
return environment
|
||||
|
||||
if currWord != '':
|
||||
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
|
||||
|
||||
|
@ -45,7 +45,7 @@ class screen():
|
||||
environment['screenData']['newCursor']['x'] = int( environment['screenData']['newContentBytes'][2])
|
||||
environment['screenData']['newCursor']['y'] = int( environment['screenData']['newContentBytes'][3])
|
||||
# analyze content
|
||||
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("ascii", "replace"))
|
||||
environment['screenData']['newContentText'] = str(environment['screenData']['newContentBytes'][4:][::2].decode("ascii", "replace")).replace('\n'," ")
|
||||
environment['screenData']['newContentAttrib'] = environment['screenData']['newContentBytes'][5:][::2]
|
||||
environment['screenData']['newContentText'] = '\n'.join(self.textWrapper.wrap(environment['screenData']['newContentText'], ))[:-2]
|
||||
|
||||
|
Reference in New Issue
Block a user