diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b91d82917..9d026222d 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,5 +1,6 @@ 2005-05-05 Don Allingham - * 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 * src/GenericFilter.py: Fix copy-n-paste errors; diff --git a/gramps2/src/plugins/PatchNames.py b/gramps2/src/plugins/PatchNames.py index 829ee5984..4413ca663 100644 --- a/gramps2/src/plugins/PatchNames.py +++ b/gramps2/src/plugins/PatchNames.py @@ -106,13 +106,25 @@ class PatchNames: for key in self.db.get_person_handles(sort_handles=False): person = self.db.get_person_from_handle(key) - first = person.get_primary_name().get_first_name() - sname = person.get_primary_name().get_surname() + name = person.get_primary_name() + first = name.get_first_name() + sname = name.get_surname() + match = _title_re.match(first) - if match: + if name.get_title(): + current_title = [name.get_title()] + else: + current_title = [] + while match: 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 + match = _nick_re.match(first) if match: groups = match.groups()