From 505a97be29cb89365d212c062910d0a6fc054e4d Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 8 Oct 2003 03:23:07 +0000 Subject: [PATCH] Make static Descendant and Ancestral filters inclusive. Fixes 819390. * src/plugins/FtmStyleDescendants.py (write_report): Change from partial phrases to the complete phrases. Consider all cases (birth date/place, death date/place, gender). Closes 810904, 810905. svn: r2213 --- ChangeLog | 5 +- src/plugins/FtmStyleDescendants.py | 357 +++++++++++++++++++++++------ 2 files changed, 292 insertions(+), 70 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e674a75e..1c6b5711a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2003-10-07 Alex Roitman * src/plugins/GraphViz.py (GraphVizDialog.get_report_filters): - Make static Descendant and Ancestral filters inclusive. + Make static Descendant and Ancestral filters inclusive. Fixes 819390. + * src/plugins/FtmStyleDescendants.py (write_report): Change from + partial phrases to the complete phrases. Consider all cases (birth + date/place, death date/place, gender). Closes 810904, 810905. 2003-10-06 Don Allingham * src/plugins/WebPage.py: Fixed ID link so that link references are diff --git a/src/plugins/FtmStyleDescendants.py b/src/plugins/FtmStyleDescendants.py index bfe935b1c..c84796f20 100644 --- a/src/plugins/FtmStyleDescendants.py +++ b/src/plugins/FtmStyleDescendants.py @@ -137,82 +137,301 @@ class FtmDescendantReport(Report.Report): self.doc.write_text(name) self.doc.end_bold() - # add source information here - - self.doc.write_text(self.endnotes(pri_name)) - # Check birth record birth = person.getBirth() - death = person.getDeath() + bplace = birth.getPlaceName() + bdate = birth.getDate() - birth_valid = birth.getDate() != "" or birth.getPlaceName() != "" - death_valid = death.getDate() != "" or death.getPlaceName() != "" + death = person.getDeath() + dplace = death.getPlaceName() + ddate = death.getDate() + + birth_valid = bdate != "" or bplace != "" + death_valid = ddate != "" or dplace != "" if birth_valid or death_valid: - self.doc.write_text(' ') + if person.getGender() == RelLib.Person.male: + if bdate: + if bplace: + if ddate: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s " + "in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s" + "%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'death_date' : ddate,'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s " + "in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'death_date' : ddate, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s " + "in %(birth_place)s %(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s in " + "%(birth_place)s%(birth_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'birth_endnotes' : self.endnotes(birth), + }) + else: + if ddate: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s" + "%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'death_date' : ddate, + 'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'death_date' : ddate, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born " + "%(birth_date)s%(birth_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, + 'birth_endnotes' : self.endnotes(birth), + }) + else: + if bplace: + if ddate: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s" + "%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_place' : bplace, 'death_date' : ddate, 'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_place' : bplace, 'death_date' : ddate, + }) + else: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_place' : bplace,'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s was born " + "in %(birth_place)s%(birth_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_place' : bplace, + 'birth_endnotes' : self.endnotes(birth), + }) + else: + if ddate: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s died %(death_date)s in " + "%(death_place)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_date' : ddate, 'death_place' : dplace, + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(male_name)s%(endnotes)s " + "died %(death_date)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_date' : ddate, + 'death_endnotes' : self.endnotes(death), + }) + else: + if dplace: + self.doc.write_text(_("%(male_name)s%(endnotes)s died " + "in %(death_place)s%(death_endnotes)s.") % { + 'male_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_endnotes' : self.endnotes(death), + 'death_place' : dplace, + }) + else: + if bdate: + if bplace: + if ddate: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s" + "%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s" + "%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'death_date' : ddate,'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s" + "%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'death_date' : ddate, + }) + else: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s in %(birth_place)s" + "%(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'birth_place' : bplace, + 'death_place' : dplace, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s " + "in %(birth_place)s %(birth_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'birth_date' : bdate, 'birth_place' : bplace, + }) + else: + if ddate: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s" + "%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_date' : bdate, 'death_date' : ddate, + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_date' : bdate, 'death_date' : ddate, + }) + else: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born %(birth_date)s%(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_date' : bdate, 'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was " + "born %(birth_date)s%(birth_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'birth_date' : bdate, + }) + else: + if bplace: + if ddate: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s in %(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_place' : bplace, 'death_date' : ddate, 'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died %(death_date)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_place' : bplace, 'death_date' : ddate, + }) + else: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born in %(birth_place)s%(birth_endnotes)s, " + "and died in %(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'death_endnotes' : self.endnotes(death), + 'birth_place' : bplace,'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s was born " + "in %(birth_place)s%(birth_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'birth_endnotes' : self.endnotes(birth), + 'birth_place' : bplace, + }) + else: + if ddate: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s died %(death_date)s in " + "%(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_endnotes' : self.endnotes(death), + 'death_date' : ddate, 'death_place' : dplace, + }) + else: + self.doc.write_text(_("%(female_name)s%(endnotes)s " + "died %(death_date)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_endnotes' : self.endnotes(death), + 'death_date' : ddate, + }) + else: + if dplace: + self.doc.write_text(_("%(female_name)s%(endnotes)s died " + "in %(death_place)s%(death_endnotes)s.") % { + 'female_name' : '', 'endnotes' : self.endnotes(pri_name), + 'death_endnotes' : self.endnotes(death), + 'birth_date' : bdate, 'death_place' : dplace, + }) else: - self.doc.write_text('.') - - if birth_valid: - date = birth.getDateObj().get_start_date() - place = birth.getPlaceName() - if place[-1:] == '.': - place = place[:-1] - if date.getDate() != "": - if place != "": - t = _("was born %(date)s in %(place)s%(endnotes)s") % { - 'date' : date.getDate(), - 'place' : place, - 'endnotes' : self.endnotes(birth), - } - else: - t = _("was born %(date)s%(endnotes)s") % { - 'date' : date.getDate(), - 'endnotes' : self.endnotes(birth), - } - else: - if place != "": - t = _("was born in %(place)s%(endnotes)s") % { - 'place' : place, - 'endnotes' : self.endnotes(birth), - } - else: - t = '' - - self.doc.write_text(t) - if death_valid: - self.doc.write_text(', ') - else: - self.doc.write_text('. ') + self.doc.write_text( "%s." % self.endnotes(pri_name) ) - if death_valid: - date = death.getDateObj().get_start_date() - place = death.getPlaceName() - if place[-1:] == '.': - place = place[:-1] - if date.getDate() != "": - if place != "": - t = _("and died %(date)s in %(place)s%(endnotes)s.") % { - 'date' : date.getDate(), - 'place' : place, - 'endnotes' : self.endnotes(death), - } - else: - t = _("and died %(date)s%(endnotes)s.") % { - 'date' : date.getDate(), - 'endnotes' : self.endnotes(death), - } - else: - if place != "": - t = _("and died in %(place)s%(endnotes)s.") % { - 'place' : place, - 'endnotes' : self.endnotes(death), - } - else: - t = '.' - self.doc.write_text(t + ' ') - + self.doc.write_text(' ') self.print_parents(person,death_valid) self.print_spouse(person) self.doc.end_paragraph() @@ -787,7 +1006,7 @@ class FtmDescendantReport(Report.Report): death_valid = ddate != "" or dplace != "" birth_valid = bdate != "" or bplace != "" - if birth_valid and death_valid: + if birth_valid or death_valid: if spouse.getGender() == RelLib.Person.male: if bdate: if bplace: