From 7cba49c1a4a01fdb92e760fc65a9c80ee7001b1f Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Tue, 24 Jul 2007 04:09:35 +0000 Subject: [PATCH] Various reports treat an unknown gender differently (#0001113) svn: r8767 --- ChangeLog | 5 +++++ src/plugins/IndivComplete.py | 4 +++- src/plugins/Summary.py | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index edbe76f37..474a24420 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-07-23 Brian Matherly + * src/plugins/IndivComplete.py: + * src/plugins/Summary.py: + Various reports treat an unknown gender differently (#0001113) + 2007-07-23 Don Allingham * src/plugins/ExtractCity.py: Allow editable columns diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index e087d0d96..ffb43244c 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -468,8 +468,10 @@ class IndivCompleteReport(Report): self.normal_cell("%s:" % _("Gender")) if self.start_person.get_gender() == RelLib.Person.MALE: self.normal_cell(_("Male")) - else: + elif self.start_person.get_gender() == RelLib.Person.FEMALE: self.normal_cell(_("Female")) + else: + self.normal_cell(_("Unknown")) self.doc.end_row() family_handle = self.start_person.get_main_parents_family_handle() diff --git a/src/plugins/Summary.py b/src/plugins/Summary.py index 027f12748..dd56dc403 100644 --- a/src/plugins/Summary.py +++ b/src/plugins/Summary.py @@ -66,6 +66,7 @@ def build_report(database,person): missing_bday = 0 males = 0 females = 0 + unknowns = 0 bytes = 0 namelist = [] notfound = [] @@ -102,8 +103,10 @@ def build_report(database,person): missing_bday = missing_bday + 1 if person.get_gender() == RelLib.Person.FEMALE: females = females + 1 - else: + elif person.get_gender() == RelLib.Person.MALE: males = males + 1 + else: + unknowns += 1 if name.get_surname() not in namelist: namelist.append(name.get_surname()) @@ -112,6 +115,7 @@ def build_report(database,person): text = text + "%s: %d\n" % (_("Number of individuals"),len(personList)) text = text + "%s: %d\n" % (_("Males"),males) text = text + "%s: %d\n" % (_("Females"),females) + text = text + "%s: %d\n" % (_("Individuals with unknown gender"),unknowns) text = text + "%s: %d\n" % (_("Individuals with incomplete names"),incomp_names) text = text + "%s: %d\n" % (_("Individuals missing birth dates"),missing_bday) text = text + "%s: %d\n" % (_("Disconnected individuals"),disconnected)