diff --git a/ChangeLog b/ChangeLog index a2541102b..0b55b4329 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-06 Douglas S. Blank + * src/plugins/SameSurnames.py: + * src/plugins/DefaultGramplets.py: + * src/plugins/FilterByName.py: + Fixes for proper surname grouping; fix for all of a person's name + 2008-03-05 Douglas S. Blank * src/plugins/FilterByName.py (run): fixed a couple of missing translations; name counts were slightly off diff --git a/src/plugins/DefaultGramplets.py b/src/plugins/DefaultGramplets.py index d0b103ac8..ace704603 100644 --- a/src/plugins/DefaultGramplets.py +++ b/src/plugins/DefaultGramplets.py @@ -219,9 +219,11 @@ class TopSurnamesGramplet(Gramplet): for person_handle in people: person = self.dbstate.db.get_person_from_handle(person_handle) if person: - surname = person.get_primary_name().get_surname().strip() - surnames[surname] = surnames.get(surname, 0) + 1 - representative_handle[surname] = person_handle + allnames = [person.get_primary_name()] + person.get_alternate_names() + for name in allnames: + surname = name.get_group_name().strip() + surnames[surname] = surnames.get(surname, 0) + 1 + representative_handle[surname] = person_handle if cnt % 350 == 0: yield True cnt += 1 @@ -294,9 +296,11 @@ class SurnameCloudGramplet(Gramplet): for person_handle in people: person = self.dbstate.db.get_person_from_handle(person_handle) if person: - surname = person.get_primary_name().get_surname().strip() - surnames[surname] = surnames.get(surname, 0) + 1 - representative_handle[surname] = person_handle + allnames = [person.get_primary_name()] + person.get_alternate_names() + for name in allnames: + surname = name.get_group_name().strip() + surnames[surname] = surnames.get(surname, 0) + 1 + representative_handle[surname] = person_handle if cnt % 350 == 0: yield True cnt += 1 @@ -599,10 +603,10 @@ class StatsGramplet(Gramplet): person = database.get_person_from_handle(person_handle) names = [person.get_primary_name()] + person.get_alternate_names() for name in names: - if name.get_first_name() == "" or name.get_surname() == "": + if name.get_first_name() == "" or name.get_group_name() == "": incomp_names = incomp_names + 1 - if name.get_surname() not in namelist: - namelist.append(name.get_surname()) + if name.get_group_name() not in namelist: + namelist.append(name.get_group_name()) if ((not person.get_main_parents_family_handle()) and (not len(person.get_family_handle_list()))): disconnected = disconnected + 1 diff --git a/src/plugins/FilterByName.py b/src/plugins/FilterByName.py index 00a484cf3..291076e5f 100644 --- a/src/plugins/FilterByName.py +++ b/src/plugins/FilterByName.py @@ -87,7 +87,7 @@ def run(database, document, filter_name): for person_handle in people: person = database.get_person_from_handle(person_handle) for name in [person.get_primary_name()] + person.get_alternate_names(): - if name.get_surname() == "" or name.get_first_name() == "": + if name.get_group_name() == "" or name.get_first_name() == "": stab.row(person, sdb.birth_date_obj(person), str(person.get_primary_name().get_type())) matches += 1 @@ -132,7 +132,7 @@ def run(database, document, filter_name): person = database.get_person_from_handle(person_handle) if person: names = [person.get_primary_name()] + person.get_alternate_names() - surnames = list(set([name.get_surname() for name in names])) + surnames = list(set([name.get_group_name() for name in names])) for surname in surnames: namelist[surname] = namelist.get(surname, 0) + 1 surnames = namelist.keys() diff --git a/src/plugins/SameSurnames.py b/src/plugins/SameSurnames.py index c9f72e190..7f9dc8aab 100644 --- a/src/plugins/SameSurnames.py +++ b/src/plugins/SameSurnames.py @@ -37,7 +37,7 @@ class IncompleteSurname(Rule): category = _('General filters') def apply(self,db,person): for name in [person.get_primary_name()] + person.get_alternate_names(): - if name.get_surname() == "": + if name.get_group_name() == "": return True return False @@ -68,7 +68,7 @@ def run(database, document, person): rsurname = person else: surname = sdb.surname(person) - rsurname = person.get_primary_name().get_surname() + rsurname = person.get_primary_name().get_group_name() # display the title sdoc.title(_("People with the surname '%s'") % surname) sdoc.paragraph("")