From 4d89c9da3bf5d7cdd8a12c9e722cbd656206ef34 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 20 Oct 2010 19:50:00 +0000 Subject: [PATCH] fix name capitilization tool for surnames svn: r16017 --- src/plugins/tool/ChangeNames.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/tool/ChangeNames.py b/src/plugins/tool/ChangeNames.py index 8cd1521f8..7226bbf42 100644 --- a/src/plugins/tool/ChangeNames.py +++ b/src/plugins/tool/ChangeNames.py @@ -37,6 +37,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- +from gen.db import find_surname_name import const from gui.utils import ProgressMeter import GrampsDisplay @@ -243,11 +244,12 @@ class ChangeNames(tool.BatchTool, ManagedWindow.ManagedWindow): #person = Person(data) change = False for name in [person.get_primary_name()] + person.get_alternate_names(): - sname = name.get_surname() + sname = find_surname_name(handle, name.serialize()) if sname in changelist: change = True - sname = self.name_cap(sname) - name.set_surname(sname) + for surn in name.get_surname_list(): + sname = self.name_cap(surn.get_surname()) + surn.set_surname(sname) if change: #cursor.update(handle, person.serialize()) self.db.commit_person(person, transaction=self.trans)