initialize.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:griffith 作者: Strit 项目源码 文件源码
def spellcheck(self):
    global spell_support
    spell_error = False
    if self.posix and spell_support:
        if self.config.get('gtkspell', False, section='spell') == True:
            if self.config.get('notes', True, section='spell') is True and self.config.get('lang', section='spell') != '':
                try:
                    self.notes_spell = gtkspell.Spell(self.widgets['add']['notes'], self.config.get('lang', section='spell'))
                except:
                    spell_error = True
            if self.config.get('plot', True, section='spell') is True and self.config.get('lang', section='spell') != '':
                try:
                    self.plot_spell = gtkspell.Spell(self.widgets['add']['plot'], self.config.get('lang', section='spell'))
                except:
                    spell_error = True
            if spell_error:
                log.info('Dictionary not available. Spell check will be disabled.')
                if not self.config.get('notified', False, section='spell'):
                    gutils.info(_("Dictionary not available. Spellcheck will be disabled. \n" + \
                        "Please install the aspell-%s package or adjust the spellchecker preferences.") % self.config.get('lang', section='spell'), \
                        self.widgets['preferences']['window'])
                    self.config.set('notified', True, section='spell')
                    self.config.save()
    else:
        log.info('Spellchecker is not available')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号