* src/plugins/soundgen.py: Fall back to empty input.

svn: r2779
This commit is contained in:
Alex Roitman 2004-02-05 19:53:02 +00:00
parent 78fc879948
commit 8ad83d32b7
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,7 @@
2004-02-05 Alex Roitman <shura@alex.neuro.umn.edu>
* src/plugins/Merge.py (gen_key,name_compare):
Fall back to not using soundex if the charset can't be latin-1 encoded.
* src/plugins/soundgen.py: Fall back to empty input.
2004-02-05 Michel Guitel <michel.guitel@free.fr>
* doc/gramps-manual/fr/cmdline.xml: Update.

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2003 Donald N. Allingham
# Copyright (C) 2000-2004 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -75,14 +75,22 @@ class SoundGen:
if active_person:
n = active_person.getPrimaryName().getSurname()
self.name.set_text(n)
self.value.set_text(soundex.soundex(n))
try:
se_text = soundex.soundex(n)
except UnicodeEncodeError:
se_text = soundex.soundex('')
self.value.set_text(se_text)
else:
self.name.set_text("")
self.glade.get_widget("soundEx").show()
def on_apply_clicked(self,obj):
self.value.set_text(soundex.soundex(unicode(obj.get_text())))
try:
se_text = soundex.soundex(unicode(obj.get_text()))
except UnicodeEncodeError:
se_text = soundex.soundex('')
self.value.set_text(se_text)
#-------------------------------------------------------------------------
#