Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
    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)
Esempio n. 4
0
    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
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)
Esempio n. 7
0
    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
Esempio n. 8
0
    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)
Esempio n. 9
0
 def _getCustomDictFileName(self):
     return os.path.join(getSpellDirList()[-1], CUSTOM_DICT_FILE_NAME)
Esempio n. 10
0
 def _getCustomDictFileName(self):
     return os.path.join(getSpellDirList()[-1], CUSTOM_DICT_FILE_NAME)