* src/plugins/RelCalc.py: Handle IDs properly

* src/Relationship.py: Handle IDs properly
* src/home.png: added new default person icon


svn: r2838
This commit is contained in:
Don Allingham
2004-02-15 16:45:33 +00:00
parent 9cc50a74df
commit d29b4d6a57
2 changed files with 38 additions and 37 deletions

View File

@@ -69,8 +69,8 @@ class RelCalc:
def __init__(self,database,person):
self.person = person
self.db = database
self.RelClass = Plugins.relationship_class(database)
self.relationship = self.RelClass.get_relationship
self.RelClass = Plugins.relationship_class
self.relationship = self.RelClass(database)
base = os.path.dirname(__file__)
glade_file = "%s/relcalc.glade" % base
@@ -112,23 +112,24 @@ class RelCalc:
id = self.clist.get_object(iter)
other_person = self.db.get_person(id)
(rel_string,common) = self.relationship(self.person,other_person)
(rel_string,common) = self.relationship.get_relationship(self.person,other_person)
length = len(common)
if length == 1:
person = common[0]
person = self.db.find_person_from_id(common[0])
name = person.get_primary_name().get_regular_name()
commontext = " " + _("Their common ancestor is %s.") % name
elif length == 2:
p1 = common[0]
p2 = common[1]
p1 = self.db.find_person_from_id(common[0])
p2 = self.db.find_person_from_id(common[1])
commontext = " " + _("Their common ancestors are %s and %s.") % \
(p1.get_primary_name().get_regular_name(),\
p2.get_primary_name().get_regular_name())
elif length > 2:
index = 0
commontext = " " + _("Their common ancestors are : ")
for person in common:
for person_id in common:
person = self.db.find_person_form_id(person_id)
if index != 0:
commontext = commontext + ", "
commontext = commontext + person.get_primary_name().get_regular_name()