From 698a9b295f567c54177ffcbb4bf37ad617c24f09 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 6 Sep 2016 09:44:17 +0200 Subject: [PATCH] Update 62000-spell_check.py --- .../commands/onScreenChanged/62000-spell_check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py b/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py index 9c5ad11b..b1bf22c7 100644 --- a/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py +++ b/src/fenrir-package/commands/onScreenChanged/62000-spell_check.py @@ -10,6 +10,7 @@ except: class command(): def __init__(self): self.language = '' + self.spellChecker = '' def run(self, environment): if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'): @@ -19,7 +20,8 @@ class command(): return environment if environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') != self.language: try: - spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) + self.spellChecker = enchant.Dict(environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage')) + self.language = environment['runtime']['settingsManager'].getSetting(environment, 'general', 'spellCheckLanguage') except: return environment @@ -54,7 +56,7 @@ class command(): return environment if currWord != '': - if not spellChecker.check(currWord): + if not self.spellChecker.check(currWord): environment['runtime']['outputManager'].presentText(environment, 'misspelled', interrupt=True) return environment