* src/plugins/Ancestors.py: Use get_grandparents_string which is

registered in Plugins (possibly from the relationship calculator).


svn: r2843
This commit is contained in:
Alex Roitman 2004-02-15 21:52:43 +00:00
parent 983186336c
commit a4fbff223b
2 changed files with 11 additions and 6 deletions

View File

@ -2,6 +2,8 @@
* src/Relationship.py: More corrections. * src/Relationship.py: More corrections.
* src/plugins/rel_ru.py: Corrections. * src/plugins/rel_ru.py: Corrections.
* src/gramps_main.py: Corrections. * src/gramps_main.py: Corrections.
* src/plugins/Ancestors.py: Use get_grandparents_string which is
registered in Plugins (possibly from the relationship calculator).
2004-02-15 Don Allingham <dallingham@users.sourceforge.net> 2004-02-15 Don Allingham <dallingham@users.sourceforge.net>
* src/plugins/RelCalc.py: Handle IDs properly * src/plugins/RelCalc.py: Handle IDs properly

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2003 Donald N. Allingham # Copyright (C) 2003-2004 Donald N. Allingham
# Copyright (C) 2003 Tim Waugh # Copyright (C) 2003 Tim Waugh
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -33,7 +33,7 @@ import Report
import BaseDoc import BaseDoc
import RelLib import RelLib
import Errors import Errors
import Relationship import Plugins
from QuestionDialog import ErrorDialog from QuestionDialog import ErrorDialog
from gettext import gettext as _ from gettext import gettext as _
@ -55,6 +55,8 @@ class ComprehensiveAncestorsReport (Report.Report):
self.sources = [] self.sources = []
self.sourcerefs = [] self.sourcerefs = []
self.newpage = newpage self.newpage = newpage
self.RelClass = Plugins.relationship_class
self.relationship = self.RelClass(database)
table = BaseDoc.TableStyle () table = BaseDoc.TableStyle ()
table.set_column_widths ([15, 85]) table.set_column_widths ([15, 85])
@ -224,7 +226,7 @@ class ComprehensiveAncestorsReport (Report.Report):
if self.gp: if self.gp:
break break
relstring = Relationship.get_grandparents_string (self.start, relstring = self.relationship.get_grandparents_string (self.start,
self.gp)[0] self.gp)[0]
heading = _("%(name)s's maternal %(grandparents)s") % \ heading = _("%(name)s's maternal %(grandparents)s") % \
{ 'name': self.first_name_or_nick (self.start), { 'name': self.first_name_or_nick (self.start),
@ -247,7 +249,7 @@ class ComprehensiveAncestorsReport (Report.Report):
if self.gp: if self.gp:
break break
relstring = Relationship.get_grandparents_string (self.start, relstring = self.relationship.get_grandparents_string (self.start,
self.gp)[0] self.gp)[0]
if thisgen == 2: if thisgen == 2:
heading = _("%(name)s's %(parents)s") % \ heading = _("%(name)s's %(parents)s") % \
@ -430,7 +432,7 @@ class ComprehensiveAncestorsReport (Report.Report):
info += _(' in %(month_or_year)s') % \ info += _(' in %(month_or_year)s') % \
{'month_or_year': dateobj.get_date ()} {'month_or_year': dateobj.get_date ()}
placename = event.get_place_name () placename = self.database.find_place_from_id(event.get_place_id()).get_title()
if placename: if placename:
info += _(' in %(place)s') % {'place': placename} info += _(' in %(place)s') % {'place': placename}
note = event.get_note () note = event.get_note ()
@ -629,7 +631,8 @@ class ComprehensiveAncestorsReport (Report.Report):
gender = person.get_gender () gender = person.get_gender ()
first_marriage = 1 first_marriage = 1
ret = '' ret = ''
for family in person.get_family_id_list (): for family_id in person.get_family_id_list ():
family = self.database.find_family_from_id(family_id)
mother = family.get_mother_id () mother = family.get_mother_id ()
for spouse in [family.get_father_id (), mother]: for spouse in [family.get_father_id (), mother]:
if spouse == person or not spouse: if spouse == person or not spouse: