2003-08-11 Tim Waugh <twaugh@redhat.com>

* src/plugins/Ancestors.py: Use Relationship.get_grandparents_string.


svn: r1990
This commit is contained in:
Tim Waugh 2003-08-11 17:10:17 +00:00
parent f879bc29b1
commit b997206104
2 changed files with 13 additions and 19 deletions

View File

@ -1,3 +1,6 @@
2003-08-11 Tim Waugh <twaugh@redhat.com>
* src/plugins/Ancestors.py: Use Relationship.get_grandparents_string.
2003-08-10 Don Allingham <dallingham@users.sourceforge.net> 2003-08-10 Don Allingham <dallingham@users.sourceforge.net>
* src/Relationship.py: add "get_grandparents_string" to return the * src/Relationship.py: add "get_grandparents_string" to return the
grandparents relationship between to people. grandparents relationship between to people.

View File

@ -33,6 +33,7 @@ import Report
import TextDoc import TextDoc
import RelLib import RelLib
import Errors import Errors
import Relationship
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from intl import gettext as _ from intl import gettext as _
@ -221,25 +222,15 @@ class ComprehensiveAncestorsReport (Report.Report):
if self.pgbrk: if self.pgbrk:
self.doc.page_break() self.doc.page_break()
self.doc.start_paragraph ("AR-Heading") self.doc.start_paragraph ("AR-Heading")
if thisgen > 4: for self.gp in [families[0].getFather (),
n = thisgen - 3 families[0].getMother ()]:
if n % 10 == 1 and n != 11: if self.gp:
nth = 'st' break
elif n % 10 == 2 and n != 12: heading = _("%(name)s's %(grandparents)s") % \
nth = 'nd' { 'name': self.first_name_or_nick (self.start),
elif n % 10 == 3 and n != 13: 'grandparents':
nth = 'rd' Relationship.get_grandparents_string (self.start,
else: self.gp)[0]}
nth = 'th'
heading = '%d%s great grandparents' % (n, nth)
elif thisgen == 4:
heading = 'Great grandparents'
elif thisgen == 3:
heading = 'Grandparents'
elif thisgen == 2:
heading = 'Parents'
else:
heading = 'Generation %d' % thisgen
self.doc.write_text (heading) self.doc.write_text (heading)
self.doc.end_paragraph () self.doc.end_paragraph ()
self.write_paragraphs (people) self.write_paragraphs (people)