From d05b5a100ca41e7484813b3e2fc31b0427937ae7 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Tue, 31 May 2011 07:48:27 +0000 Subject: [PATCH] Update for spell checking in Windows. svn: r17633 --- src/Spell.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Spell.py b/src/Spell.py index b46848123..bfdbd0732 100644 --- a/src/Spell.py +++ b/src/Spell.py @@ -34,7 +34,7 @@ present, we default to no spell checking. #------------------------------------------------------------------------- from gen.ggettext import gettext as _ import locale - +import constfunc #------------------------------------------------------------------------- # # Set up logging @@ -50,6 +50,13 @@ LOG = logging.getLogger(".Spell") #------------------------------------------------------------------------- import gtk +# In Windows (XP and 7) enchant must be imported before gtkspell +# otherwise import of gtkspell fails. +if constfunc.win(): + try: + import enchant + except ImportError: + LOG.warn(_("pyenchant must be installed")) try: import gtkspell HAVE_GTKSPELL = True