* 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:
parent
9c58b528d3
commit
aa57665c07
@ -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 family in familyList:
|
|
||||||
if family != None:
|
|
||||||
if len(family.getChildList()) > 0:
|
|
||||||
for child in family.getChildList():
|
for child in family.getChildList():
|
||||||
index= self.filter(child, index+1, cur_gen+1)
|
ix = max(self.map.keys())
|
||||||
return index
|
self.apply_filter(child, ix+1, cur_gen+1)
|
||||||
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()
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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,6 +211,7 @@ 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)
|
||||||
|
if generation < self.max_generations:
|
||||||
self.print_children(person)
|
self.print_children(person)
|
||||||
|
|
||||||
self.write_endnotes()
|
self.write_endnotes()
|
||||||
@ -399,6 +400,7 @@ 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')
|
||||||
|
Loading…
Reference in New Issue
Block a user