fix name capitilization tool for surnames
svn: r16017
This commit is contained in:
parent
7400976c96
commit
4d89c9da3b
@ -37,6 +37,7 @@ import gtk
|
|||||||
# gramps modules
|
# gramps modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
from gen.db import find_surname_name
|
||||||
import const
|
import const
|
||||||
from gui.utils import ProgressMeter
|
from gui.utils import ProgressMeter
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
@ -243,11 +244,12 @@ class ChangeNames(tool.BatchTool, ManagedWindow.ManagedWindow):
|
|||||||
#person = Person(data)
|
#person = Person(data)
|
||||||
change = False
|
change = False
|
||||||
for name in [person.get_primary_name()] + person.get_alternate_names():
|
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:
|
if sname in changelist:
|
||||||
change = True
|
change = True
|
||||||
sname = self.name_cap(sname)
|
for surn in name.get_surname_list():
|
||||||
name.set_surname(sname)
|
sname = self.name_cap(surn.get_surname())
|
||||||
|
surn.set_surname(sname)
|
||||||
if change:
|
if change:
|
||||||
#cursor.update(handle, person.serialize())
|
#cursor.update(handle, person.serialize())
|
||||||
self.db.commit_person(person, transaction=self.trans)
|
self.db.commit_person(person, transaction=self.trans)
|
||||||
|
Loading…
Reference in New Issue
Block a user