From cfd17f1bd9db72e6e2e693959da30ee08c1ea497 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 6 Sep 2016 09:26:05 +0200 Subject: [PATCH] Update 62000-spell_check.py --- .../commands/onScreenChanged/62000-spell_check.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py b/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py index c81fdb12..9c5ad11b 100644 --- a/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py +++ b/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py @@ -5,20 +5,24 @@ try: import enchant initialized = True except: - print('nööP') + pass class command(): def __init__(self): - pass + self.language = '' def run(self, environment): if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'): return environment if not initialized: - return environment - spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) - + return environment + if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: + try: + spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) + except: + return environment + # just when cursor move worddetection is needed if environment['screenData']['newCursor']['x'] == environment['screenData']['oldCursor']['x']: return environment