5708: Confusing results with statistic gramplet and filter; fixes suggested by PeterL's patch

svn: r19415
This commit is contained in:
Doug Blank 2012-04-30 13:21:21 +00:00
parent b557be86d9
commit 5bfe83b19f
3 changed files with 17 additions and 10 deletions

View File

@ -152,8 +152,8 @@ class StatsGramplet(Gramplet):
'Filter', 'people with unknown gender')
self.append_text(" %s" % unknowns)
self.append_text("\n")
self.link("%s:" % _("Individuals with incomplete names"),
'Filter', 'people with incomplete names')
self.link("%s:" % _("Incomplete names"),
'Filter', 'incomplete names')
self.append_text(" %s" % incomp_names)
self.append_text("\n")
self.link("%s:" % _("Individuals missing birth dates"),

View File

@ -59,8 +59,8 @@ fname_map = {'all': _('Filtering_on|all'),
'females': _('Filtering_on|females'),
'people with unknown gender':
_('Filtering_on|people with unknown gender'),
'people with incomplete names':
_('Filtering_on|people with incomplete names'),
'incomplete names':
_('Filtering_on|incomplete names'),
'people with missing birth dates':
_('Filtering_on|people with missing birth dates'),
'disconnected people': _('Filtering_on|disconnected people'),
@ -277,7 +277,7 @@ def run(database, document, filter_name, *args, **kwargs):
str(person.get_primary_name().get_type()))
matches += 1
elif (filter_name == 'people with incomplete names'):
elif (filter_name == 'incomplete names'):
stab.columns(_("Name"), _("Birth Date"), _("Name type"))
for person in database.iter_people():
for name in [person.get_primary_name()] + person.get_alternate_names():

View File

@ -113,10 +113,17 @@ class SummaryReport(Report):
with_media += 1
# Count people with incomplete names.
name = person.get_primary_name()
if name.get_first_name() == "" or name.get_surname() == "":
incomp_names += 1
for name in [person.get_primary_name()] + person.get_alternate_names():
if name.get_first_name().strip() == "":
incomp_names += 1
else:
if name.get_surname_list():
for surname in name.get_surname_list():
if surname.get_surname().strip() == "":
incomp_names += 1
else:
incomp_names += 1
# Count people without families.
if (not person.get_main_parents_family_handle() and
not len(person.get_family_handle_list())):
@ -160,7 +167,7 @@ class SummaryReport(Report):
self.doc.end_paragraph()
self.doc.start_paragraph("SR-Normal")
self.doc.write_text(_("Individuals with incomplete names: %d") %
self.doc.write_text(_("Incomplete names: %d") %
incomp_names)
self.doc.end_paragraph()