Merge branch 'testing' into dev
This commit is contained in:
+19
-18
@@ -96,26 +96,27 @@ class NWSpellCheck():
|
|||||||
lookup lists.
|
lookup lists.
|
||||||
"""
|
"""
|
||||||
self.projDict = []
|
self.projDict = []
|
||||||
if projectDict is not None:
|
self.projectDict = projectDict
|
||||||
if not os.path.isfile(projectDict):
|
|
||||||
self.projectDict = None
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
self.projectDict = projectDict
|
|
||||||
|
|
||||||
try:
|
if projectDict is None:
|
||||||
logger.debug("Loading project word list")
|
return False
|
||||||
with open(projectDict, mode="r", encoding="utf-8") as wordsFile:
|
|
||||||
for theLine in wordsFile:
|
|
||||||
theLine = theLine.strip()
|
|
||||||
if len(theLine) > 0 and theLine not in self.projDict:
|
|
||||||
self.projDict.append(theLine)
|
|
||||||
logger.debug("Project word list contains %d words" % len(self.projDict))
|
|
||||||
|
|
||||||
except Exception:
|
if not os.path.isfile(projectDict):
|
||||||
logger.error("Failed to load project word list")
|
return False
|
||||||
nw.logException()
|
|
||||||
return False
|
try:
|
||||||
|
logger.debug("Loading project word list")
|
||||||
|
with open(projectDict, mode="r", encoding="utf-8") as wordsFile:
|
||||||
|
for theLine in wordsFile:
|
||||||
|
theLine = theLine.strip()
|
||||||
|
if len(theLine) > 0 and theLine not in self.projDict:
|
||||||
|
self.projDict.append(theLine)
|
||||||
|
logger.debug("Project word list contains %d words" % len(self.projDict))
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
logger.error("Failed to load project word list")
|
||||||
|
nw.logException()
|
||||||
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user