From 79cc2ba4b1268f689cfdc01433b19e729fe38a9e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 14 Mar 2009 08:50:36 +0000 Subject: [PATCH] =?UTF-8?q?2784:=20Detailed=20Ancestral=20Report=20?= =?UTF-8?q?=E2=80=93=20center-person's=20spouse=20has=20no=20=20=20=20=20?= =?UTF-8?q?=20=20heading=20(inconsistent=20with=20Detailed=20Descendant=20?= =?UTF-8?q?Report)=202783:=20Detailed=20Ancestral=20Report=20lists=20cente?= =?UTF-8?q?r-person's=20children=20=20=20=20=20=20=20twice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn: r12334 --- src/plugins/textreport/DetAncestralReport.py | 37 ++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/plugins/textreport/DetAncestralReport.py b/src/plugins/textreport/DetAncestralReport.py index f2e5e4dc9..8c4819509 100644 --- a/src/plugins/textreport/DetAncestralReport.py +++ b/src/plugins/textreport/DetAncestralReport.py @@ -185,6 +185,9 @@ class DetAncestorReport(Report): if mother_handle is None or \ mother_handle not in self.map.values() or \ person.get_gender() == gen.lib.Person.FEMALE: + # The second test above also covers the 1. person's + # mate, which is not an ancestor and as such is not + # included in the self.map dictionary if self.listchildren: self.write_children(family) if self.inc_events: @@ -569,15 +572,15 @@ class DetAncestorReport(Report): first = 0 self.write_event(event_ref) - def write_mate(self, mate): + def write_mate(self, person): """Output birth, death, parentage, marriage and notes information """ ind = None has_info = False - for family_handle in mate.get_family_handle_list(): + for family_handle in person.get_family_handle_list(): family = self.database.get_family_from_handle(family_handle) ind_handle = None - if mate.get_gender() == gen.lib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: ind_handle = family.get_mother_handle() else: ind_handle = family.get_father_handle() @@ -602,7 +605,7 @@ class DetAncestorReport(Report): break if has_info: - self.doc.start_paragraph("DAR-Entry") + self.doc.start_paragraph("DAR-MoreHeader") plist = ind.get_media_list() @@ -613,11 +616,16 @@ class DetAncestorReport(Report): name = _nd.display_formal(ind) mark = ReportUtils.get_person_mark(self.database, ind) - self.doc.write_text(name, mark) - if name[-1:] == '.': - self.doc.write_text_citation("%s " % self.endnotes(ind)) + if family.get_relationship() == gen.lib.FamilyRelType.MARRIED: + self.doc.write_text(_("Spouse: %s") % name, mark) else: - self.doc.write_text_citation("%s. " % self.endnotes(ind)) + self.doc.write_text(_("Relationship with: %s") % name, mark) + if name[-1:] != '.': + self.doc.write_text(".") + self.doc.write_text_citation(self.endnotes(ind)) + self.doc.end_paragraph() + + self.doc.start_paragraph("DAR-Entry") first_name = ReportUtils.common_name(ind, self.usecall) print_name = first_name @@ -635,6 +643,13 @@ class DetAncestorReport(Report): self.doc.write_text_citation(text) print_name = 0 + text = ReportUtils.christened_str(self.database, ind, print_name, + self.verbose, self.endnotes, self.EMPTY_DATE, + self.EMPTY_PLACE) + if text: + self.doc.write_text_citation(text) + print_name = 0 + span = self.calc_age(ind) text = ReportUtils.died_str(self.database, ind, print_name, self.verbose, self.EMPTY_DATE, self.EMPTY_PLACE, @@ -657,12 +672,6 @@ class DetAncestorReport(Report): self.doc.end_paragraph() - if has_info and mate.get_gender() == gen.lib.Person.MALE: - if self.listchildren: - self.write_children(family) - if self.inc_events: - self.write_family_events(family) - def calc_age(self,ind): """ Calulate age.