def __init__(self, dictionaryLanguage): self.dictionaryLanguage = dictionaryLanguage self.dictionaryEncoding = None self.isTempAspellDir = False self.spellingDir = getApplicationModel().getUserProfile().getDirectory( u"spellcheck") #$NON-NLS-1$ self.aspellDir = os.path.join(self.spellingDir, u"aspell") #$NON-NLS-1$ # Initialize the aspell directory (only if it is not already initialized). ZAspellSpellCheckDictionaryHandler().initializeAspellDirectory() if isUnicodePath(self.aspellDir): self.aspellDir = self._copyAspellDirToTemp(self.aspellDir) self.isTempAspellDir = True dataDir = os.path.abspath(os.path.join(self.aspellDir, u"data")) #$NON-NLS-1$ dictDir = os.path.abspath(os.path.join(self.aspellDir, u"dict")) #$NON-NLS-1$ language = dictionaryLanguage.getLanguageCode() self.speller = Speller( (u"lang", language), #$NON-NLS-1$ (u"data-dir", dataDir), #$NON-NLS-1$ (u"dict-dir", dictDir) #$NON-NLS-1$ )