def getSpellChecker(self): langlist = self._getDictsFromConfig() + ['html'] spellDirList = getSpellDirList() spellChecker = SpellChecker(langlist, spellDirList) spellChecker.addCustomDict( os.path.join(spellDirList[-1], CUSTOM_DICT_FILE_NAME)) return spellChecker
def getSpellChecker(self): langlist = self._getDictsFromConfig() + ['html'] spellDirList = getSpellDirList() spellChecker = SpellChecker(langlist, spellDirList) spellChecker.addCustomDict(os.path.join(spellDirList[-1], CUSTOM_DICT_FILE_NAME)) return spellChecker
def _fillDictsList(self): dicts = DictsFinder(getSpellDirList()).getLangList() dicts.sort() selectedDicts = filter(lambda item: item in dicts, self._getDictsFromConfig()) self.dictsList.Clear() self.dictsList.AppendItems(dicts) self.dictsList.SetCheckedStrings(selectedDicts)
def getSpellChecker (self): checker = super (HtmlTextEditor, self).getSpellChecker() htmlDictName = u'html.dic' # Copy html.dic dictionary to folder with user's permissions if not self._htmlDictIsCopied: srcname = os.path.join (getSpellDirList()[0], htmlDictName) dstname = os.path.join (getSpellDirList()[-1], htmlDictName) if srcname != dstname: try: shutil.copyfile (srcname, dstname) except IOError: return checker self._htmlDictIsCopied = True checker.addCustomDict (os.path.join (getSpellDirList()[-1], htmlDictName)) return checker
def _fillDictsList(self): dicts = DictsFinder(getSpellDirList()).getLangList() dicts.sort() selectedDicts = [item for item in self._getDictsFromConfig() if item in dicts] self.dictsList.Clear() self.dictsList.AppendItems(dicts) self.dictsList.SetCheckedStrings(selectedDicts)
def _fillDictsList(self): dicts = DictsFinder(getSpellDirList()).getLangList() dicts.sort() selectedDicts = [ item for item in self._getDictsFromConfig() if item in dicts ] self.dictsList.Clear() self.dictsList.AppendItems(dicts) self.dictsList.SetCheckedStrings(selectedDicts)
def getSpellChecker(self): checker = super(HtmlTextEditor, self).getSpellChecker() htmlDictName = u'html.dic' # Copy html.dic dictionary to folder with user's permissions if not self._htmlDictIsCopied: srcname = os.path.join(getSpellDirList()[0], htmlDictName) dstname = os.path.join(getSpellDirList()[-1], htmlDictName) if srcname != dstname: try: shutil.copyfile(srcname, dstname) except IOError: return checker self._htmlDictIsCopied = True checker.addCustomDict(os.path.join(getSpellDirList()[-1], htmlDictName)) return checker
def _fillDictsList (self): dicts = DictsFinder (getSpellDirList()).getLangList() dicts.sort() selectedDicts = filter ( lambda item: item in dicts, self._getDictsFromConfig()) self.dictsList.Clear() self.dictsList.AppendItems (dicts) self.dictsList.SetCheckedStrings (selectedDicts)
def _getCustomDictFileName(self): return os.path.join(getSpellDirList()[-1], CUSTOM_DICT_FILE_NAME)