initial say prev,curr,next line
This commit is contained in:
parent
333232d7ce
commit
12734e3930
22
src/fenrir-package/commands/commands/next_line.py
Normal file
22
src/fenrir-package/commands/commands/next_line.py
Normal 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
|
23
src/fenrir-package/commands/commands/prev_line.py
Normal file
23
src/fenrir-package/commands/commands/prev_line.py
Normal 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
|
Loading…
Reference in New Issue
Block a user