Just log a warning rather than show an error dialog if spell checker cannot be imported
svn: r20197
This commit is contained in:
parent
b4ee8915d6
commit
97f26ed118
@ -49,12 +49,19 @@ LOG = logging.getLogger(".Spell")
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gi.repository import Gtk
|
||||
from gi import Repository
|
||||
|
||||
HAVE_GTKSPELL = False
|
||||
|
||||
# Attempting to import gtkspell gives an error dialog if gtkspell is not
|
||||
# available so test first and log just a warning to the console instead.
|
||||
repository = Repository.get_default()
|
||||
if repository.enumerate_versions("Gtkspell"):
|
||||
try:
|
||||
from gi.repository import Gtkspell
|
||||
HAVE_GTKSPELL = True
|
||||
except ImportError:
|
||||
HAVE_GTKSPELL = False
|
||||
except:
|
||||
pass
|
||||
|
||||
if not HAVE_GTKSPELL:
|
||||
LOG.warn(_("Spelling checker is not installed"))
|
||||
|
Loading…
Reference in New Issue
Block a user