add lock, initial outputManager

This commit is contained in:
chrys
2016-07-14 23:00:02 +02:00
parent 7b8d212af6
commit d9f8229aa5
13 changed files with 44 additions and 26 deletions

View File

@ -4,15 +4,14 @@ 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']['newContentText'].replace(" ","") == '':
environment['runtime']['speechDriver'].speak("empty line")
environment['runtime']['outputManager'].speakText(environment, "empty line")
else:
environment['runtime']['speechDriver'].speak(environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
return environment
def setCallback(self, callback):
pass

View File

@ -4,10 +4,9 @@ class command():
def __init__(self):
pass
def run(self, environment):
environment['runtime']['speechDriver'].cancel()
environment['screenData']['oldCursorReview'] = {'x':-1,'y':-1}
environment['screenData']['newCursorReview'] = {'x':-1,'y':-1}
environment['runtime']['speechDriver'].speak("leve review mode")
environment['runtime']['outputManager'].speakText(environment, "leve review mode")
return environment
def setCallback(self, callback):
pass

View File

@ -4,7 +4,6 @@ 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()
@ -12,9 +11,9 @@ class command():
environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] + 1
if environment['screenData']['newContentText'].replace(" ","") == '':
environment['runtime']['speechDriver'].speak("empty line")
environment['runtime']['outputManager'].speakText(environment, "empty line")
else:
environment['runtime']['speechDriver'].speak(environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
return environment
def setCallback(self, callback):
pass

View File

@ -4,7 +4,6 @@ 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()
@ -12,9 +11,9 @@ class command():
environment['screenData']['newCursorReview']['y'] = environment['screenData']['newCursorReview']['y'] - 1
if environment['screenData']['newContentText'].replace(" ","") == '':
environment['runtime']['speechDriver'].speak("empty line")
environment['runtime']['outputManager'].speakText(environment, "empty line")
else:
environment['runtime']['speechDriver'].speak(environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursorReview']['y']])
return environment
def setCallback(self, callback):

View File

@ -4,7 +4,7 @@ class command():
def __init__(self):
pass
def run(self, environment):
environment['runtime']['speechDriver'].cancel()
environment['runtime']['outputManager'].interruptOutput(environment)
def setCallback(self, callback):
pass
def shutdown(self):

View File

@ -5,7 +5,7 @@ class command():
pass
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']:
environment['runtime']['speechDriver'].cancel()
environment['runtime']['outputManager'].interruptOutput(environment)
return environment
def setCallback(self, callback):
pass

View File

@ -6,7 +6,7 @@ class command():
def run(self, environment):
if environment['screenData']['newDelta'] != environment['screenData']['oldDelta'] or \
environment['screenData']['newTTY'] != environment['screenData']['oldTTY']:
environment['runtime']['speechDriver'].speak(environment['screenData']['newDelta'])
environment['runtime']['outputManager'].speakText(environment, environment['screenData']['newDelta'], Interrupt=False)
return environment
def setCallback(self, callback):
pass