[ocrfeeder] Catch exceptions when creating the GTKSpell
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Catch exceptions when creating the GTKSpell
- Date: Tue, 8 Feb 2011 15:51:07 +0000 (UTC)
commit e5348d1a9228661bf6fdf3138fc2df8e9cd1ce73
Author: Joaquim Rocha <jrocha igalia com>
Date: Tue Feb 8 16:45:15 2011 +0100
Catch exceptions when creating the GTKSpell
GTKSpell will raise an exception when it can't find the given locale.
src/ocrfeeder/studio/widgetPresenter.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index b7519bd..bf0aed8 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -515,7 +515,10 @@ class BoxEditor(gtk.ScrolledWindow, gobject.GObject):
text_properties_notebook.set_tab_pos(gtk.POS_TOP)
# Textview widget
self.text_widget = gtk.TextView()
- gtkspell.Spell(self.text_widget, OCRFEEDER_DEFAULT_LOCALE)
+ try:
+ gtkspell.Spell(self.text_widget, OCRFEEDER_DEFAULT_LOCALE)
+ except:
+ pass # The locale was not found by GTKSpell, ignoring...
self.text_widget.set_wrap_mode(gtk.WRAP_WORD)
self.text_content = self.text_widget.get_buffer()
self.text_content.connect('changed', self.editedByUser)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]