RedNotebook spell check problem

RedNotebook is a journal app that is very attractive for things like writing your diary. On Ubuntu 16.04 the packaged version in the canonical repositories (rednotebook v 1.10) has a bug that deactivates spell checking capability. This is claimed to be fixed in the version 1.3o on the rednotebook official website, but it appears that the version 1.30 in the ppa:rednotebook/stable has not received this update and still has this bug.

The bug is related to the fact that the python-gtkspell has changed to python-spellcheck with some changes also to the internal function calls.

The following patch will fix it. Copy this code to a patch file and apply the patch to /usr/share/rednotebook/rednotebook/gui/editor.py  (of course you need root privileges).

*** editor.py 2016-09-03 20:58:36.462628695 +0200
— editor_new.py 2016-09-03 20:52:04.472764303 +0200
***************
*** 26,34 ****
import pango

try:
! import gtkspell
except ImportError:
! gtkspell = None

from rednotebook.gui import t2t_highlight
from rednotebook import undo
— 26,34 —-
import pango

try:
! import gtkspellcheck
except ImportError:
! gtkspellcheck = None

from rednotebook.gui import t2t_highlight
from rednotebook import undo
***************
*** 268,274 ****

def can_spell_check(self):
“””Return True if spell checking is available.”””
! return gtkspell is not None

def is_spell_check_enabled(self):
return self._spell_checker is not None
— 268,274 —-

def can_spell_check(self):
“””Return True if spell checking is available.”””
! return gtkspellcheck is not None

def is_spell_check_enabled(self):
return self._spell_checker is not None
***************
*** 286,292 ****
assert self.can_spell_check()
assert self._spell_checker is None
try:
! self._spell_checker = gtkspell.Spell(self.day_text_view)
except gobject.GError as err:
logging.error(‘Spell checking could not be enabled: %s’ % err)
self._spell_checker = None
— 286,292 —-
assert self.can_spell_check()
assert self._spell_checker is None
try:
! self._spell_checker = gtkspellcheck.SpellChecker(self.day_text_view)
except gobject.GError as err:
logging.error(‘Spell checking could not be enabled: %s’ % err)
self._spell_checker = None

Advertisements