* src/plugins/PatchNames.py: handle multiple titles (bug 1196056)

* src/plugins/ReorderIDs.py: bring up to speed with new handle/id methodology,


svn: r4490
This commit is contained in:
Don Allingham 2005-05-05 22:12:33 +00:00
parent 40cb50ac8c
commit 8f8a0bb642
2 changed files with 18 additions and 5 deletions

View File

@ -1,5 +1,6 @@
2005-05-05 Don Allingham <don@gramps-project.org> 2005-05-05 Don Allingham <don@gramps-project.org>
* src/ReorderIDs.py: bring up to speed with new handle/id methodology, * src/plugins/PatchNames.py: handle multiple titles (bug 1196056)
* src/plugins/ReorderIDs.py: bring up to speed with new handle/id methodology,
2005-05-05 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-05-05 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/GenericFilter.py: Fix copy-n-paste errors; * src/GenericFilter.py: Fix copy-n-paste errors;

View File

@ -106,13 +106,25 @@ class PatchNames:
for key in self.db.get_person_handles(sort_handles=False): for key in self.db.get_person_handles(sort_handles=False):
person = self.db.get_person_from_handle(key) person = self.db.get_person_from_handle(key)
first = person.get_primary_name().get_first_name() name = person.get_primary_name()
sname = person.get_primary_name().get_surname() first = name.get_first_name()
sname = name.get_surname()
match = _title_re.match(first) match = _title_re.match(first)
if match: if name.get_title():
current_title = [name.get_title()]
else:
current_title = []
while match:
groups = match.groups() groups = match.groups()
self.title_list.append((key,groups[0],groups[1])) first = groups[1]
current_title.append(groups[0])
match = _title_re.match(first)
if current_title:
self.title_list.append((key," ".join(current_title),first))
continue continue
match = _nick_re.match(first) match = _nick_re.match(first)
if match: if match:
groups = match.groups() groups = match.groups()