From 590623b61d39b8e22f13a44f02425c0b77cdb269 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 7 Aug 2016 17:00:39 +0200 Subject: [PATCH] polish auto output --- config/settings/settings.conf | 12 +++--- ...0-read_char_if_cursor_change_horizontal.py | 24 ----------- ...000-read_line_if_cursor_change_vertical.py | 21 ---------- .../onScreenChanged/50000-speak_key_echo.py | 25 ------------ .../onScreenChanged/60000-speak_word_echo.py | 40 ------------------- .../65000-speak_char_delete_echo.py | 31 -------------- .../onScreenChanged/70000-speak_incomming.py | 21 ---------- .../onScreenChanged/80000-speak_tty_change.py | 17 -------- src/fenrir-package/screen/linux.py | 5 ++- 9 files changed, 10 insertions(+), 186 deletions(-) delete mode 100644 src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py delete mode 100644 src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py delete mode 100644 src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py delete mode 100644 src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py delete mode 100644 src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py delete mode 100644 src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py delete mode 100644 src/fenrir-package/commands/onScreenChanged/80000-speak_tty_change.py diff --git a/config/settings/settings.conf b/config/settings/settings.conf index 7ee045d7..8a533db9 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -5,13 +5,13 @@ theme=default [speech] enabled=True -driver=espeak -rate=800 +driver=speechd +rate=50 +volume=100 pitch=50 module=espeak -voice=en-us -language=en-us -volume=200 +voice=de +language=de [braille] enabled=False @@ -22,7 +22,7 @@ driver=linux [keyboard] keyboardLayout=desktop -charEcho=False +charEcho=True charDeleteEcho=True wordEcho=True interruptOnKeyPress=False diff --git a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py b/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py deleted file mode 100644 index 35080cd9..00000000 --- a/src/fenrir-package/commands/onInput/54000-read_char_if_cursor_change_horizontal.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/python -import time -class command(): - def __init__(self): - pass - def run(self, environment): - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: - return environment - if environment['screenData']['newCursor']['y'] != environment['screenData']['oldCursor']['y'] or\ - environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']: - return environment - if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']].strip(" \t\n") == '': - pass - #environment['runtime']['outputManager'].presentText(environment, "blank",True) - else: - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']][environment['screenData']['newCursor']['x']],interrupt=True) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py b/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py deleted file mode 100644 index 08391870..00000000 --- a/src/fenrir-package/commands/onInput/55000-read_line_if_cursor_change_vertical.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/python - -class command(): - def __init__(self): - pass - def run(self, environment): - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: - return environment - if environment['screenData']['newCursor']['y'] == environment['screenData']['oldCursor']['y']: - return environment - if environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']].strip(" \t\n") == '': - environment['runtime']['outputManager'].presentText(environment, "blank", soundIconName='EmptyLine', interrupt=True) - else: - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']], True) - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py b/src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py deleted file mode 100644 index f953dbdf..00000000 --- a/src/fenrir-package/commands/onScreenChanged/50000-speak_key_echo.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/python - -class command(): - def __init__(self): - pass - def run(self, environment): - - if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charEcho'): - return environment - if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']: - return environment - - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - - if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: - return environment - - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py b/src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py deleted file mode 100644 index e3696095..00000000 --- a/src/fenrir-package/commands/onScreenChanged/60000-speak_word_echo.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/python -from utils import word_utils - -class command(): - def __init__(self): - pass - def run(self, environment): - if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'wordEcho'): - return environment - - # just when typing is a new word - if environment['screenData']['newCursor']['x'] <= environment['screenData']['oldCursor']['x']: - return environment - - # TTY Change is no new word - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - - # here we just arrow arround (left right) no changes - if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ - environment['screenData']['newNegativeDelta'] == '': - return environment - # this is not the end of the word - if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ - environment['screenData']['newNegativeDelta'] != ' ': - return environment - - # japp its a finished word... announce it:x - newContent = environment['screenData']['newContentText'].split('\n')[environment['screenData']['newCursor']['y']] - x, y, currWord = word_utils.getCurrentWord(environment['screenData']['newCursor']['x'], 0, newContent) - - if environment['screenData']['newCursor']['x'] > 0 and \ - newContent[environment['screenData']['newCursor']['x']- 1] == ' ': - environment['runtime']['outputManager'].presentText(environment, currWord, interrupt=True) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py b/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py deleted file mode 100644 index 4ae3dc45..00000000 --- a/src/fenrir-package/commands/onScreenChanged/65000-speak_char_delete_echo.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/python - -class command(): - def __init__(self): - pass - def run(self, environment): - - if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'keyboard', 'charDeleteEcho'): - return environment - # detect typing - if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']: - return environment - # TTY change - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - # More than just a deletion happend - if environment['screenData']['newDelta'] != environment['screenData']['oldDelta']: - return environment - # No deletion - if environment['screenData']['newNegativeDelta'] == environment['screenData']['oldNegativeDelta']: - return environment - if environment['screenData']['newNegativeDelta'] == '': - return environment - - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newNegativeDelta'], interrupt=True) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py b/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py deleted file mode 100644 index 3b0489cf..00000000 --- a/src/fenrir-package/commands/onScreenChanged/70000-speak_incomming.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/python - -class command(): - def __init__(self): - pass - def run(self, environment): - if environment['screenData']['newCursor']['x'] > environment['screenData']['oldCursor']['x']: - return environment - - if environment['screenData']['newTTY'] != environment['screenData']['oldTTY']: - return environment - if environment['screenData']['newDelta'] == environment['screenData']['oldDelta']: - return environment - - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=False) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/commands/onScreenChanged/80000-speak_tty_change.py b/src/fenrir-package/commands/onScreenChanged/80000-speak_tty_change.py deleted file mode 100644 index 91b1b7a5..00000000 --- a/src/fenrir-package/commands/onScreenChanged/80000-speak_tty_change.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/python - -class command(): - def __init__(self): - pass - def run(self, environment): - - if environment['screenData']['newTTY'] == environment['screenData']['oldTTY']: - return environment - environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY') - environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], interrupt=True) - - return environment - def setCallback(self, callback): - pass - def shutdown(self): - pass diff --git a/src/fenrir-package/screen/linux.py b/src/fenrir-package/screen/linux.py index 37afcefe..2de91710 100644 --- a/src/fenrir-package/screen/linux.py +++ b/src/fenrir-package/screen/linux.py @@ -80,7 +80,10 @@ class screen(): environment['screenData']['newContentText'][diffStart:].splitlines()) diffList = list(diff) + environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ ')) environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- ')) - + else: + environment['screenData']['newNegativeDelta'] = '' + environment['screenData']['newDelta'] = '' return environment