continue command modernisation

This commit is contained in:
chrys 2016-09-19 21:54:35 +02:00
parent de9bb4627f
commit b6178fa933
46 changed files with 182 additions and 211 deletions

View File

@ -4,17 +4,17 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'reads the contents of the current screen' return 'reads the contents of the current screen'
def run(self, environment): def run(self, environment):
if environment['screenData']['newContentText'].strip() == '': if environment['screenData']['newContentText'].strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "screen is empty", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "screen is empty", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'],interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'],interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -6,9 +6,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'reads from the cursor to the bottom of the screen' return 'reads from the cursor to the bottom of the screen'
@ -21,10 +21,10 @@ class command():
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, environment['screenData']['newContentText']) textAfterCursor = mark_utils.getTextAfterMark(cursorPos, environment['screenData']['newContentText'])
if textAfterCursor.strip() == '': if textAfterCursor.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, textAfterCursor, interrupt=True) environment['runtime']['outputManager'].presentText(environment, textAfterCursor, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -6,9 +6,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'Reads from the top of the screen to the cursor position' return 'Reads from the top of the screen to the cursor position'
@ -21,11 +21,11 @@ class command():
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, environment['screenData']['newContentText']) textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, environment['screenData']['newContentText'])
if textBeforeCursor.strip() == '': if textBeforeCursor.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, textBeforeCursor, interrupt=True) environment['runtime']['outputManager'].presentText(environment, textBeforeCursor, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'current word.' return 'current word.'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \
word_utils.getCurrentWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) word_utils.getCurrentWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currWord.strip() == '': if currWord.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -6,9 +6,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'phonetically spells the current word' return 'phonetically spells the current word'
@ -20,7 +20,7 @@ class command():
x, y, currWord = \ x, y, currWord = \
word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText']) word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText'])
if currWord.strip() == '': if currWord.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
firstSequence = True firstSequence = True
@ -28,6 +28,6 @@ class command():
currChar = char_utils.getPhonetic(c) currChar = char_utils.getPhonetic(c)
environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=firstSequence) environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=firstSequence)
firstSequence = False firstSequence = False
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,21 +5,20 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'displays the position of the review cursor' return 'displays the position of the review cursor'
def run(self, environment): def run(self, environment):
# Prefer review cursor over text cursor # Prefer review cursor over text cursor
if (environment['screenData']['newCursorReview'] != None): if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy() cursorPos = environment['screenData']['newCursorReview'].copy()
else: else:
cursorPos = environment['screenData']['newCursor'].copy() cursorPos = environment['screenData']['newCursor'].copy()
environment['runtime']['outputManager'].presentText(environment, "line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True) environment['runtime']['outputManager'].presentText(environment, "line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -6,9 +6,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'presents the date' return 'presents the date'
@ -21,6 +21,5 @@ class command():
# present the time via speak and braile, there is no soundicon, interrupt the current speech # present the time via speak and braile, there is no soundicon, interrupt the current speech
environment['runtime']['outputManager'].presentText(environment, dateString , soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, dateString , soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'decrease sound volume' return 'decrease sound volume'
@ -18,11 +18,10 @@ class command():
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.1: if value < 0.1:
value = 0.1 value = 0.1
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'decreases the pitch of the speech' return 'decreases the pitch of the speech'
@ -16,10 +16,9 @@ class command():
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.0: if value < 0.0:
value = 0.0 value = 0.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'decreases the rate of the speech' return 'decreases the rate of the speech'
@ -16,10 +16,9 @@ class command():
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.0: if value < 0.0:
value = 0.0 value = 0.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'decreases the volume of the speech' return 'decreases the volume of the speech'
@ -16,11 +16,10 @@ class command():
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.1: if value < 0.1:
value = 0.1 value = 0.1
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,9 +4,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'exits review mode' return 'exits review mode'
@ -14,11 +14,11 @@ class command():
if (environment['screenData']['oldCursorReview'] == None) and \ if (environment['screenData']['oldCursorReview'] == None) and \
(environment['screenData']['newCursorReview'] == None): (environment['screenData']['newCursorReview'] == None):
environment['runtime']['outputManager'].presentText(environment, "Not in review mode", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "Not in review mode", interrupt=True)
return environment return
environment['screenData']['oldCursorReview'] = None environment['screenData']['oldCursorReview'] = None
environment['screenData']['newCursorReview'] = None environment['screenData']['newCursorReview'] = None
environment['runtime']['outputManager'].presentText(environment, "leve review mode", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "leve review mode", interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -8,18 +8,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'selects the first clipboard' return 'selects the first clipboard'
def run(self, environment): def run(self, environment):
if len(environment['commandBuffer']['clipboard']) == 0: if len(environment['commandBuffer']['clipboard']) == 0:
environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True)
return environment return
environment['commandBuffer']['currClipboard'] = 0 environment['commandBuffer']['currClipboard'] = 0
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,18 +0,0 @@
#!/bin/python
class command():
def __init__(self):
pass
def initialize(self, environment):
return environment
def shutdown(self, environment):
return environment
def getDescription(self, environment):
return 'No Description found'
def run(self, environment):
environment['input']['keyForeward'] = True
environment['runtime']['outputManager'].presentText(environment, 'Foreward next keypress', interrupt=True)
return environment
def setCallback(self, callback):
pass

View File

@ -4,15 +4,15 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'sends the following keypress to the terminal' return 'sends the following keypress to the terminal'
def run(self, environment): def run(self, environment):
environment['input']['keyForeward'] = True environment['input']['keyForeward'] = True
environment['runtime']['outputManager'].presentText(environment, 'Foreward next keypress', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'Foreward next keypress', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'adjusts the volume for in coming sounds' return 'adjusts the volume for in coming sounds'
@ -18,10 +18,9 @@ class command():
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOn', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOn', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'increases the pitch of the speech' return 'increases the pitch of the speech'
@ -16,10 +16,9 @@ class command():
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'increase the speech rat' return 'increase the speech rat'
@ -16,10 +16,9 @@ class command():
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'increase the speech volume' return 'increase the speech volume'
@ -16,10 +16,9 @@ class command():
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value)) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'shows the indention level for the current line' return 'shows the indention level for the current line'
@ -21,10 +21,10 @@ class command():
x, y, currLine = \ x, y, currLine = \
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText']) line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], environment['screenData']['newContentText'])
if currLine.strip() == '': if currLine.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, "indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True) environment['runtime']['outputManager'].presentText(environment, "indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -8,18 +8,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'selects the last clipboard' return 'selects the last clipboard'
def run(self, environment): def run(self, environment):
if len(environment['commandBuffer']['clipboard']) == 0: if len(environment['commandBuffer']['clipboard']) == 0:
environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True)
return environment return
environment['commandBuffer']['currClipboard'] = len(environment['commandBuffer']['clipboard']) -1 environment['commandBuffer']['currClipboard'] = len(environment['commandBuffer']['clipboard']) -1
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,14 +4,14 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'displays the last received text' return 'displays the last received text'
def run(self, environment): def run(self, environment):
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -8,9 +8,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'pastes the text from the currently selected clipboard' return 'pastes the text from the currently selected clipboard'
@ -18,11 +18,11 @@ class command():
currClipboard = environment['commandBuffer']['currClipboard'] currClipboard = environment['commandBuffer']['currClipboard']
if currClipboard < 0: if currClipboard < 0:
environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True)
return environment return
with open("/dev/tty" + environment['screenData']['newTTY'], 'w') as fd: with open("/dev/tty" + environment['screenData']['newTTY'], 'w') as fd:
for c in environment['commandBuffer']['clipboard'][currClipboard]: for c in environment['commandBuffer']['clipboard'][currClipboard]:
fcntl.ioctl(fd, termios.TIOCSTI, c) fcntl.ioctl(fd, termios.TIOCSTI, c)
time.sleep(0.02) time.sleep(0.02)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'speaks the currently selected text that will be copied to the clipboard' return 'speaks the currently selected text that will be copied to the clipboard'
@ -15,7 +15,7 @@ class command():
if (environment['commandBuffer']['Marks']['1'] == None) or \ if (environment['commandBuffer']['Marks']['1'] == None) or \
(environment['commandBuffer']['Marks']['2'] == None): (environment['commandBuffer']['Marks']['2'] == None):
environment['runtime']['outputManager'].presentText(environment, "please set begin and endmark", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "please set begin and endmark", interrupt=True)
return environment return
# use the last first and the last setted mark as range # use the last first and the last setted mark as range
startMark = environment['commandBuffer']['Marks']['1'].copy() startMark = environment['commandBuffer']['Marks']['1'].copy()
@ -25,10 +25,10 @@ class command():
marked = mark_utils.getTextBetweenMarks(startMark, endMark, environment['screenData']['newContentText']) marked = mark_utils.getTextBetweenMarks(startMark, endMark, environment['screenData']['newContentText'])
if marked.strip() == '': if marked.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, marked, interrupt=True) environment['runtime']['outputManager'].presentText(environment, marked, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review to the next character and presents it' return 'moves review to the next character and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currChar = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currChar = \
char_utils.getNextChar(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) char_utils.getNextChar(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currChar.strip() == '': if currChar.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -8,16 +8,16 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'selects the next clipboard' return 'selects the next clipboard'
def run(self, environment): def run(self, environment):
if len(environment['commandBuffer']['clipboard']) == 0: if len(environment['commandBuffer']['clipboard']) == 0:
environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True)
return environment return
environment['commandBuffer']['currClipboard'] += 1 environment['commandBuffer']['currClipboard'] += 1
if environment['commandBuffer']['currClipboard'] > len(environment['commandBuffer']['clipboard']) -1: if environment['commandBuffer']['currClipboard'] > len(environment['commandBuffer']['clipboard']) -1:
environment['commandBuffer']['currClipboard'] = 0 environment['commandBuffer']['currClipboard'] = 0
@ -25,6 +25,6 @@ class command():
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=False) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=False)
else: else:
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review to the next line and presents it' return 'moves review to the next line and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currLine = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currLine = \
line_utils.getNextLine(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) line_utils.getNextLine(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currLine.strip() == '': if currLine.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review to the next word and presents it' return 'moves review to the next word and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \
word_utils.getNextWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) word_utils.getNextWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currWord.strip() == '': if currWord.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review to the previous character and presents it' return 'moves review to the previous character and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currChar = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currChar = \
char_utils.getPrevChar(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) char_utils.getPrevChar(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currChar.strip() == '': if currChar.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -8,16 +8,16 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'selects the previous clipboard' return 'selects the previous clipboard'
def run(self, environment): def run(self, environment):
if len(environment['commandBuffer']['clipboard']) == 0: if len(environment['commandBuffer']['clipboard']) == 0:
environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True)
return environment return
environment['commandBuffer']['currClipboard'] -= 1 environment['commandBuffer']['currClipboard'] -= 1
if environment['commandBuffer']['currClipboard'] < 0: if environment['commandBuffer']['currClipboard'] < 0:
environment['commandBuffer']['currClipboard'] = len(environment['commandBuffer']['clipboard']) -1 environment['commandBuffer']['currClipboard'] = len(environment['commandBuffer']['clipboard']) -1
@ -25,6 +25,6 @@ class command():
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=False) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=False)
else: else:
environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review to the previous line and presents it' return 'moves review to the previous line and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currLine = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currLine = \
line_utils.getPrevLine(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) line_utils.getPrevLine(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currLine.strip() == '': if currLine.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True)
return environment return
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,9 +5,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'moves review focus to the previous word and presents it' return 'moves review focus to the previous word and presents it'
@ -19,10 +19,10 @@ class command():
environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \ environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \
word_utils.getPrevWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText']) word_utils.getPrevWord(environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], environment['screenData']['newContentText'])
if currWord.strip() == '': if currWord.strip(" \t\n") == '':
environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "blank", interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,15 +4,15 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'exits Fenrir' return 'exits Fenrir'
def run(self, environment): def run(self, environment):
environment['generalInformation']['running'] = False environment['generalInformation']['running'] = False
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,9 +4,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'removes marks from selected text' return 'removes marks from selected text'
@ -15,6 +15,6 @@ class command():
environment['commandBuffer']['Marks']['2'] = None environment['commandBuffer']['Marks']['2'] = None
environment['commandBuffer']['Marks']['3'] = None environment['commandBuffer']['Marks']['3'] = None
environment['runtime']['outputManager'].presentText(environment, 'Remove marks', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'Remove marks', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -12,20 +12,22 @@ class command():
self.language = '' self.language = ''
self.spellChecker = None self.spellChecker = None
def initialize(self, environment): def initialize(self, environment):
return environment self.updateSpellLanguage(environment)
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'removes the current word from the exceptions dictionary' return 'removes the current word from the exceptions dictionary'
def updateSpellLanguage(self, environment):
self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage'))
self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')
def run(self, environment): def run(self, environment):
if not initialized: if not initialized:
environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True)
return environment return environment
if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language:
try: try:
self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) self.updateSpellLanguage(environment)
self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')
except: except:
return environment return environment
@ -44,7 +46,6 @@ class command():
else: else:
self.spellChecker.remove(currWord) self.spellChecker.remove(currWord)
environment['runtime']['outputManager'].presentText(environment, currWord + ' removed',soundIcon='Accept', interrupt=True) environment['runtime']['outputManager'].presentText(environment, currWord + ' removed',soundIcon='Accept', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,15 +4,15 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'move review to bottom of screen' return 'move review to bottom of screen'
def run(self, environment): def run(self, environment):
environment['screenData']['newCursorReview'] = { 'x': 0, 'y':environment['screenData']['lines']} environment['screenData']['newCursorReview'] = { 'x': 0, 'y':environment['screenData']['lines']}
environment['runtime']['outputManager'].presentText(environment, "Bottom", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "Bottom", interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -5,16 +5,15 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'move review to top of screen' return 'move review to top of screen'
def run(self, environment): def run(self, environment):
environment['screenData']['newCursorReview'] = {'x':0,'y':0} environment['screenData']['newCursorReview'] = {'x':0,'y':0}
environment['runtime']['outputManager'].presentText(environment, "Top", interrupt=True) environment['runtime']['outputManager'].presentText(environment, "Top", interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,16 +4,16 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'places marks to select text to copy to the clipboard' return 'places marks to select text to copy to the clipboard'
def run(self, environment): def run(self, environment):
if environment['screenData']['newCursorReview'] == None: if environment['screenData']['newCursorReview'] == None:
environment['runtime']['outputManager'].presentText(environment, 'no review cursor', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'no review cursor', interrupt=True)
return environment return
if environment['commandBuffer']['Marks']['1'] == None: if environment['commandBuffer']['Marks']['1'] == None:
environment['commandBuffer']['Marks']['1'] = environment['screenData']['newCursorReview'].copy() environment['commandBuffer']['Marks']['1'] = environment['screenData']['newCursorReview'].copy()
@ -24,7 +24,6 @@ class command():
environment['commandBuffer']['Marks']['3'] = environment['screenData']['newCursorReview'].copy() environment['commandBuffer']['Marks']['3'] = environment['screenData']['newCursorReview'].copy()
environment['runtime']['outputManager'].presentText(environment, 'set mark', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'set mark', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -12,22 +12,24 @@ class command():
self.language = '' self.language = ''
self.spellChecker = None self.spellChecker = None
def initialize(self, environment): def initialize(self, environment):
return environment self.updateSpellLanguage(environment)
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'checks the spelling of the current word' return 'checks the spelling of the current word'
def updateSpellLanguage(self, environment):
self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage'))
self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')
def run(self, environment): def run(self, environment):
if not initialized: if not initialized:
environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True)
return environment return
if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language:
try: try:
self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) self.updateSpellLanguage(environment)
self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')
except: except:
return environment return
if (environment['screenData']['newCursorReview'] != None): if (environment['screenData']['newCursorReview'] != None):
cursorPos = environment['screenData']['newCursorReview'].copy() cursorPos = environment['screenData']['newCursorReview'].copy()
@ -42,6 +44,5 @@ class command():
if not self.spellChecker.check(currWord): if not self.spellChecker.check(currWord):
environment['runtime']['outputManager'].presentText(environment, 'misspelled',soundIcon='mispell', interrupt=True) environment['runtime']['outputManager'].presentText(environment, 'misspelled',soundIcon='mispell', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -6,9 +6,9 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'presents the time' return 'presents the time'
@ -21,6 +21,5 @@ class command():
# present the time via speak and braile, there is no soundicon, interrupt the current speech # present the time via speak and braile, there is no soundicon, interrupt the current speech
environment['runtime']['outputManager'].presentText(environment, timeString , soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, timeString , soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,18 +4,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'enables or disables automatic reading of new text as it appears' return 'enables or disables automatic reading of new text as it appears'
def run(self, environment): def run(self, environment):
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'autoReadIncomming', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'))) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'autoReadIncomming', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming')))
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'):
environment['runtime']['outputManager'].presentText(environment, "autoread enabled", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "autoread enabled", soundIcon='', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, "autoread disabled", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "autoread disabled", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,18 +4,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'enables or disables automatic spell checking' return 'enables or disables automatic spell checking'
def run(self, environment): def run(self, environment):
environment = environment['runtime']['settingsManager'].setSetting(environment, 'general', 'autoSpellCheck', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'))) environment['runtime']['settingsManager'].setSetting(environment, 'general', 'autoSpellCheck', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck')))
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'):
environment['runtime']['outputManager'].presentText(environment, "auto spellcheck enabled", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "auto spellcheck enabled", soundIcon='', interrupt=True)
else: else:
environment['runtime']['outputManager'].presentText(environment, "auto spellcheck disabled", soundIcon='', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "auto spellcheck disabled", soundIcon='', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,18 +4,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'enables and disables output in braille' return 'enables and disables output in braille'
def run(self, environment): def run(self, environment):
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "braille disabled", soundIcon='BrailleOff', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "braille disabled", soundIcon='BrailleOff', interrupt=True)
environment = environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'))) environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled')))
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "braille enabled", soundIcon='BrailleOn', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "braille enabled", soundIcon='BrailleOn', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -15,14 +15,14 @@ class command():
environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled') or \ environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled') or \
environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "fenrir muted", soundIcon='Accept', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "fenrir muted", soundIcon='Accept', interrupt=True)
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','False') environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','False')
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','False') environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','False')
environment = environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','False') environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','False')
else: else:
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','True') environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','True')
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','True') environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','True')
environment = environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','True') environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','True')
environment['runtime']['outputManager'].presentText(environment, "fenrir unmuted", soundIcon='Cancel', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "fenrir unmuted", soundIcon='Cancel', interrupt=True)
return
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,18 +4,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'enables or disables sound' return 'enables or disables sound'
def run(self, environment): def run(self, environment):
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "sound disabled", soundIcon='SoundOff', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "sound disabled", soundIcon='SoundOff', interrupt=True)
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'))) environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled')))
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "sound enabled", soundIcon='SoundOn', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "sound enabled", soundIcon='SoundOn', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -4,18 +4,18 @@ class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
return environment pass
def shutdown(self, environment): def shutdown(self, environment):
return environment pass
def getDescription(self, environment): def getDescription(self, environment):
return 'enables or disables speech' return 'enables or disables speech'
def run(self, environment): def run(self, environment):
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "speech disabled", soundIcon='SpeechOff', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "speech disabled", soundIcon='SpeechOff', interrupt=True)
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'))) environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled')))
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'):
environment['runtime']['outputManager'].presentText(environment, "speech enabled", soundIcon='SpeechOn', interrupt=True) environment['runtime']['outputManager'].presentText(environment, "speech enabled", soundIcon='SpeechOn', interrupt=True)
return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass