From e1ae9c619ebb07d857cf21dad98c62afbf1ea7c4 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 21 Sep 2005 17:13:26 +0000 Subject: [PATCH] * src/plugins/DetAncestralReport.py: fix endnotes for null sources * src/plugins/DetDescendantReport.py: fix endnotes for null sources * src/plugins/FtmStyleAncestors.py: fix endnotes for null sources svn: r5212 --- gramps2/ChangeLog | 3 +++ gramps2/src/ReportUtils.py | 4 ++-- gramps2/src/plugins/DetAncestralReport.py | 2 +- gramps2/src/plugins/DetDescendantReport.py | 3 ++- gramps2/src/plugins/FtmStyleAncestors.py | 6 ++++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 6852f7eda..fa6074364 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,7 @@ 2005-09-21 Don Allingham + * src/plugins/DetAncestralReport.py: fix endnotes for null sources + * src/plugins/DetDescendantReport.py: fix endnotes for null sources + * src/plugins/FtmStyleAncestors.py: fix endnotes for null sources * src/ReportUtils.py: fix typo * src/plugins/NavWebPage.py: handle contact page issues, including random commas and missing image. diff --git a/gramps2/src/ReportUtils.py b/gramps2/src/ReportUtils.py index 50ec78932..cb3e77750 100644 --- a/gramps2/src/ReportUtils.py +++ b/gramps2/src/ReportUtils.py @@ -1314,7 +1314,7 @@ def married_rel_str(database,person,family,is_first=True): if person.get_gender() == RelLib.Person.MALE: text = _('He had an unmarried relationship with %(spouse)s.') % values else: - text = _('She hand an unmarried relationship with %(spouse)s.') % values + text = _('She had an unmarried relationship with %(spouse)s.') % values else: if person.get_gender() == RelLib.Person.MALE: text = _('He had relationship with %(spouse)s.') % values @@ -1330,7 +1330,7 @@ def married_rel_str(database,person,family,is_first=True): if person.get_gender() == RelLib.Person.MALE: text = _('He had an unmarried relationship with %(spouse)s.') % values else: - text = _('She hand an unmarried relationship with %(spouse)s.') % values + text = _('She had an unmarried relationship with %(spouse)s.') % values else: if person.get_gender() == RelLib.Person.MALE: text = _('He also had relationship with %(spouse)s.') % values diff --git a/gramps2/src/plugins/DetAncestralReport.py b/gramps2/src/plugins/DetAncestralReport.py index 6f9a6fd75..08f1c5b90 100644 --- a/gramps2/src/plugins/DetAncestralReport.py +++ b/gramps2/src/plugins/DetAncestralReport.py @@ -520,7 +520,7 @@ class DetAncestorReport(Report.Report): self.doc.end_paragraph() def endnotes(self,obj): - if not self.includeSources: + if not obj or not self.includeSources: return "" msg = cStringIO.StringIO() slist = obj.get_source_references() diff --git a/gramps2/src/plugins/DetDescendantReport.py b/gramps2/src/plugins/DetDescendantReport.py index 974902e73..859a88dc1 100644 --- a/gramps2/src/plugins/DetDescendantReport.py +++ b/gramps2/src/plugins/DetDescendantReport.py @@ -545,8 +545,9 @@ class DetDescendantReport(Report.Report): self.doc.end_paragraph() def endnotes(self,obj): - if not self.includeSources: + if not obj or not self.includeSources: return "" + msg = cStringIO.StringIO() slist = obj.get_source_references() if slist: diff --git a/gramps2/src/plugins/FtmStyleAncestors.py b/gramps2/src/plugins/FtmStyleAncestors.py index ef2583c65..430058328 100644 --- a/gramps2/src/plugins/FtmStyleAncestors.py +++ b/gramps2/src/plugins/FtmStyleAncestors.py @@ -175,6 +175,8 @@ class FtmAncestorReport(Report.Report): self.doc.end_paragraph() def endnotes(self,obj): + if not obj: + return "" msg = cStringIO.StringIO() slist = obj.get_source_references() if slist: @@ -197,9 +199,9 @@ class FtmAncestorReport(Report.Report): self.sref_map[self.sref_index] = ref msg.write("%d" % self.sref_index) msg.write('') - str = msg.getvalue() + value = msg.getvalue() msg.close() - return str + return value def print_notes(self,person): note = person.get_note()