Merge pull request #47 from vkbo/bugfixes
Bugfixes, dictionary fatal error
This commit is contained in:
@@ -219,6 +219,9 @@ class Config:
|
|||||||
for i in range(10):
|
for i in range(10):
|
||||||
self.recentList[i] = self._parseLine(cnfParse, cnfSec, "recent%d" % i,self.CNF_STR, self.recentList[i])
|
self.recentList[i] = self._parseLine(cnfParse, cnfSec, "recent%d" % i,self.CNF_STR, self.recentList[i])
|
||||||
|
|
||||||
|
# Check Certain Values for None
|
||||||
|
self.spellLanguage = self._checkNone(self.spellLanguage)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def saveConfig(self):
|
def saveConfig(self):
|
||||||
@@ -379,4 +382,12 @@ class Config:
|
|||||||
)
|
)
|
||||||
return cnfDefault
|
return cnfDefault
|
||||||
|
|
||||||
|
def _checkNone(self, checkVal):
|
||||||
|
if checkVal is None:
|
||||||
|
return None
|
||||||
|
if isinstance(checkVal, str):
|
||||||
|
if checkVal.lower == "none":
|
||||||
|
return None
|
||||||
|
return checkVal
|
||||||
|
|
||||||
# End Class Config
|
# End Class Config
|
||||||
|
|||||||
@@ -32,11 +32,15 @@ class NWSpellEnchant(NWSpellCheck):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def setLanguage(self, theLang, projectDict=None):
|
def setLanguage(self, theLang, projectDict=None):
|
||||||
if projectDict is None:
|
try:
|
||||||
self.theDict = enchant.Dict(theLang)
|
if projectDict is None:
|
||||||
else:
|
self.theDict = enchant.Dict(theLang)
|
||||||
self.theDict = enchant.DictWithPWL(theLang, projectDict)
|
else:
|
||||||
logger.debug("Enchant spell checking for language %s loaded" % theLang)
|
self.theDict = enchant.DictWithPWL(theLang, projectDict)
|
||||||
|
logger.debug("Enchant spell checking for language %s loaded" % theLang)
|
||||||
|
except:
|
||||||
|
logger.error("Failed to load enchant spell checking for language %s" % theLang)
|
||||||
|
self.theDict = None
|
||||||
return
|
return
|
||||||
|
|
||||||
def checkWord(self, theWord):
|
def checkWord(self, theWord):
|
||||||
|
|||||||
Reference in New Issue
Block a user