diff --git a/src/fenrir-package/commands/commands/curr_screen.py b/src/fenrir-package/commands/commands/curr_screen.py index 9d6d9bb5..37b303bc 100644 --- a/src/fenrir-package/commands/commands/curr_screen.py +++ b/src/fenrir-package/commands/commands/curr_screen.py @@ -4,17 +4,17 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'reads the contents of the current screen' 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) else: environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'],interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/curr_screen_after_cursor.py b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py index 3a49c8b1..eff88c14 100644 --- a/src/fenrir-package/commands/commands/curr_screen_after_cursor.py +++ b/src/fenrir-package/commands/commands/curr_screen_after_cursor.py @@ -6,9 +6,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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']) - if textAfterCursor.strip() == '': + if textAfterCursor.strip(" \t\n") == '': environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) else: environment['runtime']['outputManager'].presentText(environment, textAfterCursor, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/curr_screen_before_cursor.py b/src/fenrir-package/commands/commands/curr_screen_before_cursor.py index 57f996c1..b88e3a18 100644 --- a/src/fenrir-package/commands/commands/curr_screen_before_cursor.py +++ b/src/fenrir-package/commands/commands/curr_screen_before_cursor.py @@ -6,9 +6,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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']) - if textBeforeCursor.strip() == '': + if textBeforeCursor.strip(" \t\n") == '': environment['runtime']['outputManager'].presentText(environment, "blank", soundIcon='EmptyLine', interrupt=True) else: environment['runtime']['outputManager'].presentText(environment, textBeforeCursor, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/curr_word.py b/src/fenrir-package/commands/commands/curr_word.py index dc0015d7..fde9d509 100644 --- a/src/fenrir-package/commands/commands/curr_word.py +++ b/src/fenrir-package/commands/commands/curr_word.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'current word.' @@ -19,10 +19,10 @@ class command(): environment['screenData']['newCursorReview']['x'], environment['screenData']['newCursorReview']['y'], currWord = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/curr_word_phonetic.py b/src/fenrir-package/commands/commands/curr_word_phonetic.py index a6bd6ca1..373aef85 100644 --- a/src/fenrir-package/commands/commands/curr_word_phonetic.py +++ b/src/fenrir-package/commands/commands/curr_word_phonetic.py @@ -6,9 +6,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'phonetically spells the current word' @@ -20,7 +20,7 @@ class command(): x, y, currWord = \ 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) else: firstSequence = True @@ -28,6 +28,6 @@ class command(): currChar = char_utils.getPhonetic(c) environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=firstSequence) firstSequence = False - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/cursor_position.py b/src/fenrir-package/commands/commands/cursor_position.py index 385f9633..23068e08 100644 --- a/src/fenrir-package/commands/commands/cursor_position.py +++ b/src/fenrir-package/commands/commands/cursor_position.py @@ -5,21 +5,20 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'displays the position of the review cursor' def run(self, environment): # Prefer review cursor over text cursor - if (environment['screenData']['newCursorReview'] != None): cursorPos = environment['screenData']['newCursorReview'].copy() else: cursorPos = environment['screenData']['newCursor'].copy() environment['runtime']['outputManager'].presentText(environment, "line "+ str(cursorPos['y']+1) + " column "+ str(cursorPos['x']+1), interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/date.py b/src/fenrir-package/commands/commands/date.py index 5a1584b0..ae59e8f2 100644 --- a/src/fenrir-package/commands/commands/date.py +++ b/src/fenrir-package/commands/commands/date.py @@ -6,9 +6,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 environment['runtime']['outputManager'].presentText(environment, dateString , soundIcon='', interrupt=True) - return environment def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/dec_sound_volume.py b/src/fenrir-package/commands/commands/dec_sound_volume.py index c1517a29..9f0586d9 100644 --- a/src/fenrir-package/commands/commands/dec_sound_volume.py +++ b/src/fenrir-package/commands/commands/dec_sound_volume.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'decrease sound volume' @@ -18,11 +18,10 @@ class command(): value = round((math.ceil(10 * value) / 10) - 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/dec_speech_pitch.py b/src/fenrir-package/commands/commands/dec_speech_pitch.py index 876da939..0360d0f3 100644 --- a/src/fenrir-package/commands/commands/dec_speech_pitch.py +++ b/src/fenrir-package/commands/commands/dec_speech_pitch.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'decreases the pitch of the speech' @@ -16,10 +16,9 @@ class command(): value = round((math.ceil(10 * value) / 10) - 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/dec_speech_rate.py b/src/fenrir-package/commands/commands/dec_speech_rate.py index fec74154..b3c2455a 100644 --- a/src/fenrir-package/commands/commands/dec_speech_rate.py +++ b/src/fenrir-package/commands/commands/dec_speech_rate.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'decreases the rate of the speech' @@ -16,10 +16,9 @@ class command(): value = round((math.ceil(10 * value) / 10) - 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/dec_speech_volume.py b/src/fenrir-package/commands/commands/dec_speech_volume.py index a6362276..94760bc7 100644 --- a/src/fenrir-package/commands/commands/dec_speech_volume.py +++ b/src/fenrir-package/commands/commands/dec_speech_volume.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'decreases the volume of the speech' @@ -16,11 +16,10 @@ class command(): value = round((math.ceil(10 * value) / 10) - 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/exit_review.py b/src/fenrir-package/commands/commands/exit_review.py index 60b7d3e7..eb8e24f8 100644 --- a/src/fenrir-package/commands/commands/exit_review.py +++ b/src/fenrir-package/commands/commands/exit_review.py @@ -4,9 +4,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'exits review mode' @@ -14,11 +14,11 @@ class command(): if (environment['screenData']['oldCursorReview'] == None) and \ (environment['screenData']['newCursorReview'] == None): environment['runtime']['outputManager'].presentText(environment, "Not in review mode", interrupt=True) - return environment + return environment['screenData']['oldCursorReview'] = None environment['screenData']['newCursorReview'] = None environment['runtime']['outputManager'].presentText(environment, "leve review mode", interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/first_clipboard.py b/src/fenrir-package/commands/commands/first_clipboard.py index 57971984..ee1a8950 100644 --- a/src/fenrir-package/commands/commands/first_clipboard.py +++ b/src/fenrir-package/commands/commands/first_clipboard.py @@ -8,18 +8,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'selects the first clipboard' def run(self, environment): if len(environment['commandBuffer']['clipboard']) == 0: environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) - return environment + return environment['commandBuffer']['currClipboard'] = 0 environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/foreward_keypress.py b/src/fenrir-package/commands/commands/foreward_keypress.py deleted file mode 100644 index 92294298..00000000 --- a/src/fenrir-package/commands/commands/foreward_keypress.py +++ /dev/null @@ -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 diff --git a/src/fenrir-package/commands/commands/forward_keypress.py b/src/fenrir-package/commands/commands/forward_keypress.py index 903304f1..0a2025ed 100644 --- a/src/fenrir-package/commands/commands/forward_keypress.py +++ b/src/fenrir-package/commands/commands/forward_keypress.py @@ -4,15 +4,15 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'sends the following keypress to the terminal' 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 diff --git a/src/fenrir-package/commands/commands/inc_sound_volume.py b/src/fenrir-package/commands/commands/inc_sound_volume.py index 7527e72b..3728d72b 100644 --- a/src/fenrir-package/commands/commands/inc_sound_volume.py +++ b/src/fenrir-package/commands/commands/inc_sound_volume.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'adjusts the volume for in coming sounds' @@ -18,10 +18,9 @@ class command(): value = round((math.ceil(10 * value) / 10) + 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/inc_speech_pitch.py b/src/fenrir-package/commands/commands/inc_speech_pitch.py index f66b2647..eeeba161 100644 --- a/src/fenrir-package/commands/commands/inc_speech_pitch.py +++ b/src/fenrir-package/commands/commands/inc_speech_pitch.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'increases the pitch of the speech' @@ -16,10 +16,9 @@ class command(): value = round((math.ceil(10 * value) / 10) + 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/inc_speech_rate.py b/src/fenrir-package/commands/commands/inc_speech_rate.py index 054f7b8d..63151e11 100644 --- a/src/fenrir-package/commands/commands/inc_speech_rate.py +++ b/src/fenrir-package/commands/commands/inc_speech_rate.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'increase the speech rat' @@ -16,10 +16,9 @@ class command(): value = round((math.ceil(10 * value) / 10) + 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/inc_speech_volume.py b/src/fenrir-package/commands/commands/inc_speech_volume.py index f09acabc..d626015e 100644 --- a/src/fenrir-package/commands/commands/inc_speech_volume.py +++ b/src/fenrir-package/commands/commands/inc_speech_volume.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'increase the speech volume' @@ -16,10 +16,9 @@ class command(): value = round((math.ceil(10 * value) / 10) + 0.1, 2) if 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) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/indent_curr_line.py b/src/fenrir-package/commands/commands/indent_curr_line.py index 88498d8c..5a4353c2 100644 --- a/src/fenrir-package/commands/commands/indent_curr_line.py +++ b/src/fenrir-package/commands/commands/indent_curr_line.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'shows the indention level for the current line' @@ -21,10 +21,10 @@ class command(): x, y, currLine = \ 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) else: environment['runtime']['outputManager'].presentText(environment, "indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/last_clipboard.py b/src/fenrir-package/commands/commands/last_clipboard.py index 01d94fb4..f917efe5 100644 --- a/src/fenrir-package/commands/commands/last_clipboard.py +++ b/src/fenrir-package/commands/commands/last_clipboard.py @@ -8,18 +8,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'selects the last clipboard' def run(self, environment): if len(environment['commandBuffer']['clipboard']) == 0: environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) - return environment + return environment['commandBuffer']['currClipboard'] = len(environment['commandBuffer']['clipboard']) -1 environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/last_incomming.py b/src/fenrir-package/commands/commands/last_incomming.py index 34b90d9f..a20a61a2 100644 --- a/src/fenrir-package/commands/commands/last_incomming.py +++ b/src/fenrir-package/commands/commands/last_incomming.py @@ -4,14 +4,14 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'displays the last received text' def run(self, environment): environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/linux_paste_clipboard.py b/src/fenrir-package/commands/commands/linux_paste_clipboard.py index e6495725..1e19725a 100644 --- a/src/fenrir-package/commands/commands/linux_paste_clipboard.py +++ b/src/fenrir-package/commands/commands/linux_paste_clipboard.py @@ -8,9 +8,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'pastes the text from the currently selected clipboard' @@ -18,11 +18,11 @@ class command(): currClipboard = environment['commandBuffer']['currClipboard'] if currClipboard < 0: environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) - return environment + return with open("/dev/tty" + environment['screenData']['newTTY'], 'w') as fd: for c in environment['commandBuffer']['clipboard'][currClipboard]: fcntl.ioctl(fd, termios.TIOCSTI, c) time.sleep(0.02) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/marked_text.py b/src/fenrir-package/commands/commands/marked_text.py index eabf5803..39af0bd0 100644 --- a/src/fenrir-package/commands/commands/marked_text.py +++ b/src/fenrir-package/commands/commands/marked_text.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 \ (environment['commandBuffer']['Marks']['2'] == None): 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 startMark = environment['commandBuffer']['Marks']['1'].copy() @@ -25,10 +25,10 @@ class command(): 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) else: environment['runtime']['outputManager'].presentText(environment, marked, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/next_char.py b/src/fenrir-package/commands/commands/next_char.py index e30805fa..8acb0e0c 100644 --- a/src/fenrir-package/commands/commands/next_char.py +++ b/src/fenrir-package/commands/commands/next_char.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/next_clipboard.py b/src/fenrir-package/commands/commands/next_clipboard.py index 7e882c0a..f30a8855 100644 --- a/src/fenrir-package/commands/commands/next_clipboard.py +++ b/src/fenrir-package/commands/commands/next_clipboard.py @@ -8,16 +8,16 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'selects the next clipboard' def run(self, environment): if len(environment['commandBuffer']['clipboard']) == 0: environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) - return environment + return environment['commandBuffer']['currClipboard'] += 1 if environment['commandBuffer']['currClipboard'] > len(environment['commandBuffer']['clipboard']) -1: environment['commandBuffer']['currClipboard'] = 0 @@ -25,6 +25,6 @@ class command(): environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=False) else: environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/next_line.py b/src/fenrir-package/commands/commands/next_line.py index 692e6e10..fe8d9362 100644 --- a/src/fenrir-package/commands/commands/next_line.py +++ b/src/fenrir-package/commands/commands/next_line.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/next_word.py b/src/fenrir-package/commands/commands/next_word.py index 0db59e0b..cf90d1ba 100644 --- a/src/fenrir-package/commands/commands/next_word.py +++ b/src/fenrir-package/commands/commands/next_word.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/prev_char.py b/src/fenrir-package/commands/commands/prev_char.py index 97c2981a..cc78a10d 100644 --- a/src/fenrir-package/commands/commands/prev_char.py +++ b/src/fenrir-package/commands/commands/prev_char.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currChar, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/prev_clipboard.py b/src/fenrir-package/commands/commands/prev_clipboard.py index 40af0eb4..452bcaee 100644 --- a/src/fenrir-package/commands/commands/prev_clipboard.py +++ b/src/fenrir-package/commands/commands/prev_clipboard.py @@ -8,16 +8,16 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'selects the previous clipboard' def run(self, environment): if len(environment['commandBuffer']['clipboard']) == 0: environment['runtime']['outputManager'].presentText(environment, 'clipboard empty', interrupt=True) - return environment + return environment['commandBuffer']['currClipboard'] -= 1 if environment['commandBuffer']['currClipboard'] < 0: 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) else: environment['runtime']['outputManager'].presentText(environment, environment['commandBuffer']['clipboard'][environment['commandBuffer']['currClipboard']], interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/prev_line.py b/src/fenrir-package/commands/commands/prev_line.py index 197b4ea8..b71a98fa 100644 --- a/src/fenrir-package/commands/commands/prev_line.py +++ b/src/fenrir-package/commands/commands/prev_line.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currLine, interrupt=True) - return environment + return def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/prev_word.py b/src/fenrir-package/commands/commands/prev_word.py index dcd0158d..04473657 100644 --- a/src/fenrir-package/commands/commands/prev_word.py +++ b/src/fenrir-package/commands/commands/prev_word.py @@ -5,9 +5,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 = \ 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) else: environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/quit_fenrir.py b/src/fenrir-package/commands/commands/quit_fenrir.py index fdd57e15..eb9e16ea 100644 --- a/src/fenrir-package/commands/commands/quit_fenrir.py +++ b/src/fenrir-package/commands/commands/quit_fenrir.py @@ -4,15 +4,15 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'exits Fenrir' def run(self, environment): environment['generalInformation']['running'] = False - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/remove_marks.py b/src/fenrir-package/commands/commands/remove_marks.py index b2cce8c9..a76f6193 100644 --- a/src/fenrir-package/commands/commands/remove_marks.py +++ b/src/fenrir-package/commands/commands/remove_marks.py @@ -4,9 +4,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'removes marks from selected text' @@ -15,6 +15,6 @@ class command(): environment['commandBuffer']['Marks']['2'] = None environment['commandBuffer']['Marks']['3'] = None environment['runtime']['outputManager'].presentText(environment, 'Remove marks', interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/remove_word_from_spell_check.py b/src/fenrir-package/commands/commands/remove_word_from_spell_check.py index 891609e7..d6ae4f99 100644 --- a/src/fenrir-package/commands/commands/remove_word_from_spell_check.py +++ b/src/fenrir-package/commands/commands/remove_word_from_spell_check.py @@ -12,20 +12,22 @@ class command(): self.language = '' self.spellChecker = None def initialize(self, environment): - return environment + self.updateSpellLanguage(environment) def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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): if not initialized: environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True) return environment if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: try: - self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) - self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') + self.updateSpellLanguage(environment) except: return environment @@ -44,7 +46,6 @@ class command(): else: self.spellChecker.remove(currWord) environment['runtime']['outputManager'].presentText(environment, currWord + ' removed',soundIcon='Accept', interrupt=True) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_bottom.py b/src/fenrir-package/commands/commands/review_bottom.py index 07f641dd..4b303c27 100644 --- a/src/fenrir-package/commands/commands/review_bottom.py +++ b/src/fenrir-package/commands/commands/review_bottom.py @@ -4,15 +4,15 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'move review to bottom of screen' def run(self, environment): environment['screenData']['newCursorReview'] = { 'x': 0, 'y':environment['screenData']['lines']} environment['runtime']['outputManager'].presentText(environment, "Bottom", interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/review_top.py b/src/fenrir-package/commands/commands/review_top.py index 9bc94c16..3647f030 100644 --- a/src/fenrir-package/commands/commands/review_top.py +++ b/src/fenrir-package/commands/commands/review_top.py @@ -5,16 +5,15 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'move review to top of screen' def run(self, environment): environment['screenData']['newCursorReview'] = {'x':0,'y':0} - environment['runtime']['outputManager'].presentText(environment, "Top", interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/set_mark.py b/src/fenrir-package/commands/commands/set_mark.py index 4b6059b1..ed0e3ad6 100644 --- a/src/fenrir-package/commands/commands/set_mark.py +++ b/src/fenrir-package/commands/commands/set_mark.py @@ -4,16 +4,16 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'places marks to select text to copy to the clipboard' def run(self, environment): if environment['screenData']['newCursorReview'] == None: environment['runtime']['outputManager'].presentText(environment, 'no review cursor', interrupt=True) - return environment + return if environment['commandBuffer']['Marks']['1'] == None: environment['commandBuffer']['Marks']['1'] = environment['screenData']['newCursorReview'].copy() @@ -24,7 +24,6 @@ class command(): environment['commandBuffer']['Marks']['3'] = environment['screenData']['newCursorReview'].copy() environment['runtime']['outputManager'].presentText(environment, 'set mark', interrupt=True) - - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/spell_check.py b/src/fenrir-package/commands/commands/spell_check.py index fb1bd083..e0fdc2a9 100644 --- a/src/fenrir-package/commands/commands/spell_check.py +++ b/src/fenrir-package/commands/commands/spell_check.py @@ -12,22 +12,24 @@ class command(): self.language = '' self.spellChecker = None def initialize(self, environment): - return environment + self.updateSpellLanguage(environment) def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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): if not initialized: environment['runtime']['outputManager'].presentText(environment, 'pychant is not installed', interrupt=True) - return environment + return if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: try: - self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) - self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') + self.updateSpellLanguage(environment) except: - return environment + return if (environment['screenData']['newCursorReview'] != None): cursorPos = environment['screenData']['newCursorReview'].copy() @@ -42,6 +44,5 @@ class command(): if not self.spellChecker.check(currWord): environment['runtime']['outputManager'].presentText(environment, 'misspelled',soundIcon='mispell', interrupt=True) - return environment def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/time.py b/src/fenrir-package/commands/commands/time.py index 49bcade2..3449eef9 100644 --- a/src/fenrir-package/commands/commands/time.py +++ b/src/fenrir-package/commands/commands/time.py @@ -6,9 +6,9 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): 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 environment['runtime']['outputManager'].presentText(environment, timeString , soundIcon='', interrupt=True) - return environment def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_auto_read.py b/src/fenrir-package/commands/commands/toggle_auto_read.py index 3339d83a..8593d5ce 100644 --- a/src/fenrir-package/commands/commands/toggle_auto_read.py +++ b/src/fenrir-package/commands/commands/toggle_auto_read.py @@ -4,18 +4,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'enables or disables automatic reading of new text as it appears' 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'): environment['runtime']['outputManager'].presentText(environment, "autoread enabled", soundIcon='', interrupt=True) else: environment['runtime']['outputManager'].presentText(environment, "autoread disabled", soundIcon='', interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_auto_spell_check.py b/src/fenrir-package/commands/commands/toggle_auto_spell_check.py index acb0d039..e0b58a12 100644 --- a/src/fenrir-package/commands/commands/toggle_auto_spell_check.py +++ b/src/fenrir-package/commands/commands/toggle_auto_spell_check.py @@ -4,18 +4,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'enables or disables automatic spell checking' 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'): environment['runtime']['outputManager'].presentText(environment, "auto spellcheck enabled", soundIcon='', interrupt=True) else: environment['runtime']['outputManager'].presentText(environment, "auto spellcheck disabled", soundIcon='', interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_braille.py b/src/fenrir-package/commands/commands/toggle_braille.py index 7145a79e..88245e76 100644 --- a/src/fenrir-package/commands/commands/toggle_braille.py +++ b/src/fenrir-package/commands/commands/toggle_braille.py @@ -4,18 +4,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'enables and disables output in braille' def run(self, environment): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): 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'): environment['runtime']['outputManager'].presentText(environment, "braille enabled", soundIcon='BrailleOn', interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_output.py b/src/fenrir-package/commands/commands/toggle_output.py index 74c25c1a..d28f4fbf 100644 --- a/src/fenrir-package/commands/commands/toggle_output.py +++ b/src/fenrir-package/commands/commands/toggle_output.py @@ -15,14 +15,14 @@ class command(): environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled') or \ environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): environment['runtime']['outputManager'].presentText(environment, "fenrir muted", soundIcon='Accept', interrupt=True) - environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','False') - environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','False') - environment = environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','False') + environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','False') + environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','False') + environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','False') else: - environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','True') - environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','True') - environment = environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','True') + environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'enabled','True') + environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled','True') + environment['runtime']['settingsManager'].setSetting(environment, 'braille', 'enabled','True') environment['runtime']['outputManager'].presentText(environment, "fenrir unmuted", soundIcon='Cancel', interrupt=True) - return + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_sound.py b/src/fenrir-package/commands/commands/toggle_sound.py index b4e4d501..cccb0a65 100644 --- a/src/fenrir-package/commands/commands/toggle_sound.py +++ b/src/fenrir-package/commands/commands/toggle_sound.py @@ -4,18 +4,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'enables or disables sound' def run(self, environment): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'): 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'): environment['runtime']['outputManager'].presentText(environment, "sound enabled", soundIcon='SoundOn', interrupt=True) - return environment + def setCallback(self, callback): pass diff --git a/src/fenrir-package/commands/commands/toggle_speech.py b/src/fenrir-package/commands/commands/toggle_speech.py index 5179b730..709d3111 100644 --- a/src/fenrir-package/commands/commands/toggle_speech.py +++ b/src/fenrir-package/commands/commands/toggle_speech.py @@ -4,18 +4,18 @@ class command(): def __init__(self): pass def initialize(self, environment): - return environment + pass def shutdown(self, environment): - return environment + pass def getDescription(self, environment): return 'enables or disables speech' def run(self, environment): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'): 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'): environment['runtime']['outputManager'].presentText(environment, "speech enabled", soundIcon='SpeechOn', interrupt=True) - return environment + def setCallback(self, callback): pass