initial say prev,curr,next line

This commit is contained in:
chrys 2016-07-13 21:40:27 +02:00
parent 333232d7ce
commit 12734e3930
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
environment['runtime']['speechDriver'].cancel()
environment['screenData']['oldCursorReview'] = environment['screenData']['newCursorReview']
if environment['screenData']['newCursorReview']['y'] == -1:
environment['screenData']['newCursorReview'] = environment['screenData']['newCursor'].copy()
if environment['screenData']['newCursorReview']['y'] + 1 < environment['screenData']['lines']:
environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] + 1
if environment['screenData']['newContentText'].replace(" ","") == '':
environment['runtime']['speechDriver'].speak("empty line")
else:
environment['runtime']['speechDriver'].speak(environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass

View File

@ -0,0 +1,23 @@
#!/bin/python
class command():
def __init__(self):
pass
def run(self, environment):
environment['runtime']['speechDriver'].cancel()
environment['screenData']['oldCursorReview'] = environment['screenData']['newCursorReview']
if environment['screenData']['newCursorReview']['y'] == -1:
environment['screenData']['newCursorReview'] = environment['screenData']['newCursor'].copy()
if environment['screenData']['newCursorReview']['y'] - 1 >= 0:
environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] - 1
if environment['screenData']['newContentText'].replace(" ","") == '':
environment['runtime']['speechDriver'].speak("empty line")
else:
environment['runtime']['speechDriver'].speak(environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
return environment
def setCallback(self, callback):
pass
def shutdown(self):
pass