Update 62000-spell_check.py
This commit is contained in:
parent
375031d3f6
commit
698a9b295f
@ -10,6 +10,7 @@ except:
|
|||||||
class command():
|
class command():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.language = ''
|
self.language = ''
|
||||||
|
self.spellChecker = ''
|
||||||
|
|
||||||
def run(self, environment):
|
def run(self, environment):
|
||||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'):
|
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'):
|
||||||
@ -19,7 +20,8 @@ class command():
|
|||||||
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:
|
||||||
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:
|
except:
|
||||||
return environment
|
return environment
|
||||||
|
|
||||||
@ -54,7 +56,7 @@ class command():
|
|||||||
return environment
|
return environment
|
||||||
|
|
||||||
if currWord != '':
|
if currWord != '':
|
||||||
if not spellChecker.check(currWord):
|
if not self.spellChecker.check(currWord):
|
||||||
environment['runtime']['outputManager'].presentText(environment, 'misspelled', interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, 'misspelled', interrupt=True)
|
||||||
|
|
||||||
return environment
|
return environment
|
||||||
|
Loading…
Reference in New Issue
Block a user