* src/plugins/FtmStyleAncestor.py (apply_filter):

Fixed generation condition.
* src/plugins/FtmStyleDescendants.py (write_report):
Do not print children if the current generation is the last.
* src/plugins/DetDescendantReport.py (filter):
Make it apply_filter, clean up and make shorter, modify numbering
algorithm so that no gaps occur in people's indices.


svn: r1649
This commit is contained in:
Alex Roitman 2003-06-03 19:48:33 +00:00
parent b7aa0d3152
commit bb645d13aa
3 changed files with 17 additions and 22 deletions

View File

@ -66,26 +66,20 @@ class DetDescendantReport(Report):
#
#
#--------------------------------------------------------------------
def filter(self,person,index, cur_gen):
#print "Filter index= ", index, cur_gen
if person == None or self.cur_gen > self.max_generations:
return index
def apply_filter(self,person,index,cur_gen=1):
if person == None or cur_gen > self.max_generations:
return
self.map[index] = person
#print "Filter: ", index, person.getPrimaryName()
if len(self.genKeys) < cur_gen:
self.genKeys.append([index])
else: self.genKeys[cur_gen-1].append(index)
#print "genKeys: ", self.genKeys
else:
self.genKeys[cur_gen-1].append(index)
if person.getFamilyList() != None:
familyList= person.getFamilyList()
for family in familyList:
if family != None:
if len(family.getChildList()) > 0:
for child in family.getChildList():
index= self.filter(child, index+1, cur_gen+1)
return index
return index
for family in person.getFamilyList():
for child in family.getChildList():
ix = max(self.map.keys())
self.apply_filter(child, ix+1, cur_gen+1)
def write_children(self, family, rptOptions):
""" List children
@ -608,8 +602,7 @@ class DetDescendantReport(Report):
def write_report(self, rptOpt):
self.cur_gen= 1
self.filter(self.start,1, 1)
#rptOpt= reportOptions()
self.apply_filter(self.start,1)
name = self.start.getPrimaryName().getRegularName()

View File

@ -58,7 +58,7 @@ class FtmAncestorReport(Report.Report):
self.sref_index = 1
def apply_filter(self,person,index,generation=1):
if person == None or index >= (1 << 30):
if person == None or generation > self.max_generations:
return
self.map[index] = (person,generation)

View File

@ -79,7 +79,7 @@ class FtmDescendantReport(Report.Report):
def apply_filter(self,person,index,generation=1):
if person == None or generation >= self.max_generations:
if person == None or generation > self.max_generations:
return
self.anc_map[index] = person
@ -211,7 +211,8 @@ class FtmDescendantReport(Report.Report):
self.print_notes(person)
self.print_more_about(person)
self.print_more_about_families(person)
self.print_children(person)
if generation < self.max_generations:
self.print_children(person)
self.write_endnotes()
self.doc.close()
@ -399,7 +400,8 @@ class FtmDescendantReport(Report.Report):
for (ind,p) in self.anc_map.items():
if p == child:
index = ind
if first:
if first:
first = 0
self.doc.start_paragraph('SubEntry')
if spouse: