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.repository import Gtk
|
||||||
|
from gi import Repository
|
||||||
|
|
||||||
try:
|
HAVE_GTKSPELL = False
|
||||||
from gi.repository import Gtkspell
|
|
||||||
HAVE_GTKSPELL = True
|
# Attempting to import gtkspell gives an error dialog if gtkspell is not
|
||||||
except ImportError:
|
# available so test first and log just a warning to the console instead.
|
||||||
HAVE_GTKSPELL = False
|
repository = Repository.get_default()
|
||||||
|
if repository.enumerate_versions("Gtkspell"):
|
||||||
|
try:
|
||||||
|
from gi.repository import Gtkspell
|
||||||
|
HAVE_GTKSPELL = True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if not HAVE_GTKSPELL:
|
if not HAVE_GTKSPELL:
|
||||||
LOG.warn(_("Spelling checker is not installed"))
|
LOG.warn(_("Spelling checker is not installed"))
|
||||||
|
Loading…
Reference in New Issue
Block a user