* src/plugins/CountAncestors.py: Use positive numbers for generations to be consistent with the rest of GRAMPS
svn: r6501
This commit is contained in:
parent
fd356770ce
commit
2945365fe8
@ -1,3 +1,7 @@
|
|||||||
|
2006-04-30 Brian Matherly <brian@gramps-project.org>
|
||||||
|
* src/plugins/CountAncestors.py: Use positive numbers for generations to be
|
||||||
|
consistent with the rest of GRAMPS
|
||||||
|
|
||||||
2006-04-30 Don Allingham <don@gramps-project.org>
|
2006-04-30 Don Allingham <don@gramps-project.org>
|
||||||
* src/RelLib/_Person.py: prevent duplicate entries in family lists
|
* src/RelLib/_Person.py: prevent duplicate entries in family lists
|
||||||
|
|
||||||
|
@ -72,13 +72,13 @@ class CountAncestors:
|
|||||||
title = _("Number of ancestors of \"%s\" by generation") % person.get_primary_name().get_name()
|
title = _("Number of ancestors of \"%s\" by generation") % person.get_primary_name().get_name()
|
||||||
text += title + ':\n'
|
text += title + ':\n'
|
||||||
thisgensize = 1
|
thisgensize = 1
|
||||||
gen = 1
|
gen = 0
|
||||||
while thisgensize > 0:
|
while thisgensize > 0:
|
||||||
thisgensize = 0
|
thisgensize = 0
|
||||||
if thisgen:
|
if thisgen:
|
||||||
thisgensize = len( thisgen )
|
thisgensize = len( thisgen )
|
||||||
gen -= 1
|
gen += 1
|
||||||
theoretical = pow(2, ( gen * -1 ) )
|
theoretical = pow(2, ( gen - 1 ) )
|
||||||
total_theoretical += theoretical
|
total_theoretical += theoretical
|
||||||
percent = ( thisgensize / theoretical ) * 100
|
percent = ( thisgensize / theoretical ) * 100
|
||||||
if thisgensize == 1 :
|
if thisgensize == 1 :
|
||||||
@ -107,7 +107,7 @@ class CountAncestors:
|
|||||||
else:
|
else:
|
||||||
percent = 0
|
percent = 0
|
||||||
|
|
||||||
text += _("Total ancestors in generations %d to -1 is %d. (%3.2f%%)\n") % (gen,allgen,percent)
|
text += _("Total ancestors in generations 2 to %d is %d. (%3.2f%%)\n") % (gen,allgen,percent)
|
||||||
|
|
||||||
top = topDialog.get_widget("summary")
|
top = topDialog.get_widget("summary")
|
||||||
textwindow = topDialog.get_widget("textwindow")
|
textwindow = topDialog.get_widget("textwindow")
|
||||||
|
Loading…
Reference in New Issue
Block a user