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

View File

@ -58,7 +58,7 @@ class FtmAncestorReport(Report.Report):
self.sref_index = 1 self.sref_index = 1
def apply_filter(self,person,index,generation=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 return
self.map[index] = (person,generation) self.map[index] = (person,generation)

View File

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