Update
svn: r2848
This commit is contained in:
parent
364e776777
commit
1ba32c9818
@ -137,7 +137,8 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
self.doc.end_paragraph ()
|
self.doc.end_paragraph ()
|
||||||
|
|
||||||
i = 1
|
i = 1
|
||||||
for source in self.sources:
|
for source_id in self.sources:
|
||||||
|
source = self.database.find_source_from_id(source_id)
|
||||||
self.doc.start_paragraph ("AR-Entry")
|
self.doc.start_paragraph ("AR-Entry")
|
||||||
self.doc.write_text ("[%d] %s" % (i, source.get_title ()))
|
self.doc.write_text ("[%d] %s" % (i, source.get_title ()))
|
||||||
author = source.get_author ()
|
author = source.get_author ()
|
||||||
@ -178,8 +179,9 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
self.doc.write_text ("Call to %s with params %s" %
|
self.doc.write_text ("Call to %s with params %s" %
|
||||||
(str (fn), str (params)))
|
(str (fn), str (params)))
|
||||||
|
|
||||||
def family (self, family, already_described):
|
def family (self, family_id, already_described):
|
||||||
ret = []
|
ret = []
|
||||||
|
family = self.database.find_family_from_id(family_id)
|
||||||
if not family:
|
if not family:
|
||||||
return ret
|
return ret
|
||||||
father = family.get_father_id ()
|
father = family.get_father_id ()
|
||||||
@ -242,15 +244,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")
|
||||||
families = pfamilies
|
family_ids = pfamilies
|
||||||
families.extend (mfamilies)
|
family_ids.extend (mfamilies)
|
||||||
for self.gp in [families[0].get_father_id (),
|
for self.gp in [self.database.find_family_from_id(family_ids[0]).get_father_id (),
|
||||||
families[0].get_mother_id ()]:
|
self.database.find_family_from_id(family_ids[0]).get_mother_id ()]:
|
||||||
if self.gp:
|
if self.gp:
|
||||||
break
|
break
|
||||||
|
|
||||||
relstring = self.relationship.get_grandparents_string (self.start,
|
relstring = self.relationship.get_grandparents_string (self.database.find_person_from_id(self.start),
|
||||||
self.gp)[0]
|
self.database.find_person_from_id(self.gp[0]))
|
||||||
if thisgen == 2:
|
if thisgen == 2:
|
||||||
heading = _("%(name)s's %(parents)s") % \
|
heading = _("%(name)s's %(parents)s") % \
|
||||||
{ 'name': self.first_name_or_nick (self.start),
|
{ 'name': self.first_name_or_nick (self.start),
|
||||||
@ -266,18 +268,23 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
|
|
||||||
next_pfamilies = []
|
next_pfamilies = []
|
||||||
next_mfamilies = []
|
next_mfamilies = []
|
||||||
for family in families:
|
for family_id in family_ids:
|
||||||
father = family.get_father_id ()
|
family = self.database.find_family_from_id(family_id)
|
||||||
|
father_id = family.get_father_id ()
|
||||||
|
father = self.database.find_person_from_id(father_id)
|
||||||
if father:
|
if father:
|
||||||
already_described.append (father)
|
already_described.append (father)
|
||||||
father_family = father.get_main_parents_family_id ()
|
father_family_id = father.get_main_parents_family_id ()
|
||||||
|
father_family = self.database.find_family_from_id(father_family_id)
|
||||||
if father_family:
|
if father_family:
|
||||||
next_pfamilies.append (father_family)
|
next_pfamilies.append (father_family)
|
||||||
|
|
||||||
mother = family.get_mother_id ()
|
mother_id = family.get_mother_id ()
|
||||||
|
mother = self.database.find_person_from_id(mother_id)
|
||||||
if mother:
|
if mother:
|
||||||
already_described.append (mother)
|
already_described.append (mother)
|
||||||
mother_family = mother.get_main_parents_family_id ()
|
mother_family_id = mother.get_main_parents_family_id ()
|
||||||
|
mother_family = self.database.find_family_from_id(mother_family_id)
|
||||||
if mother_family:
|
if mother_family:
|
||||||
next_mfamilies.append (mother_family)
|
next_mfamilies.append (mother_family)
|
||||||
|
|
||||||
@ -285,13 +292,14 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
next_mfamilies, already_described,
|
next_mfamilies, already_described,
|
||||||
thisgen + 1)
|
thisgen + 1)
|
||||||
|
|
||||||
def person (self, person,
|
def person (self, person_id,
|
||||||
suppress_children = 0,
|
suppress_children = 0,
|
||||||
short_form = 0,
|
short_form = 0,
|
||||||
already_described = [],
|
already_described = [],
|
||||||
needs_name = 0,
|
needs_name = 0,
|
||||||
from_family = None):
|
from_family = None):
|
||||||
ret = []
|
ret = []
|
||||||
|
person = self.database.find_person_from_id(person_id)
|
||||||
name = self.person_name (person)
|
name = self.person_name (person)
|
||||||
if name:
|
if name:
|
||||||
photos = person.get_photo_list ()
|
photos = person.get_photo_list ()
|
||||||
@ -320,9 +328,11 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
else:
|
else:
|
||||||
from_family_father = from_family_mother = None
|
from_family_father = from_family_mother = None
|
||||||
|
|
||||||
for family in person.get_family_id_list ():
|
for family_id in person.get_family_id_list ():
|
||||||
for partner in [family.get_father_id (),
|
family = self.database.find_family_from_id(family_id)
|
||||||
|
for partner_id in [family.get_father_id (),
|
||||||
family.get_mother_id ()]:
|
family.get_mother_id ()]:
|
||||||
|
partner = self.database.find_person_from_id(partner_id)
|
||||||
if partner == person or not partner:
|
if partner == person or not partner:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -498,7 +508,8 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def parents_of (self, person):
|
def parents_of (self, person_id):
|
||||||
|
person = self.database.find_person_from_id(person_id)
|
||||||
gender = person.get_gender ()
|
gender = person.get_gender ()
|
||||||
|
|
||||||
family = person.get_main_parents_family_id ()
|
family = person.get_main_parents_family_id ()
|
||||||
@ -574,11 +585,11 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
self.sourcerefs.append (ref)
|
self.sourcerefs.append (ref)
|
||||||
source = ref.get_base_id ()
|
source_id = ref.get_base_id ()
|
||||||
if source in self.sources:
|
if source_id in self.sources:
|
||||||
ind = self.sources.index (source) + 1
|
ind = self.sources.index (source_id) + 1
|
||||||
else:
|
else:
|
||||||
self.sources.append (source)
|
self.sources.append (source_id)
|
||||||
ind = len (self.sources)
|
ind = len (self.sources)
|
||||||
|
|
||||||
citation += "[%d" % ind
|
citation += "[%d" % ind
|
||||||
@ -590,7 +601,8 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
|
|
||||||
return citation
|
return citation
|
||||||
|
|
||||||
def person_name (self, person):
|
def person_name (self, person_id):
|
||||||
|
person = self.database.find_person_from_id(person_id)
|
||||||
primary = person.get_primary_name ()
|
primary = person.get_primary_name ()
|
||||||
|
|
||||||
name = primary.get_title ()
|
name = primary.get_title ()
|
||||||
@ -650,7 +662,8 @@ class ComprehensiveAncestorsReport (Report.Report):
|
|||||||
child_count
|
child_count
|
||||||
|
|
||||||
count = 1
|
count = 1
|
||||||
for child in childlist:
|
for child_id in childlist:
|
||||||
|
child = self.database.find_person_from_id(child_id)
|
||||||
children += self.first_name_or_nick (child)
|
children += self.first_name_or_nick (child)
|
||||||
children += self.cite_sources (child.get_primary_name ().
|
children += self.cite_sources (child.get_primary_name ().
|
||||||
get_source_references ())
|
get_source_references ())
|
||||||
|
Loading…
Reference in New Issue
Block a user