예제 #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
예제 #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
예제 #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)
예제 #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
예제 #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)
예제 #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)
예제 #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
예제 #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)
예제 #9
0
 def _getCustomDictFileName(self):
     return os.path.join(getSpellDirList()[-1], CUSTOM_DICT_FILE_NAME)
예제 #10
0
 def _getCustomDictFileName(self):
     return os.path.join(getSpellDirList()[-1], CUSTOM_DICT_FILE_NAME)