* src/plugins/CountAncestors.py: Use positive numbers for generations to be consistent with the rest of GRAMPS

svn: r6501
This commit is contained in:
Brian Matherly 2006-04-30 21:43:45 +00:00
parent 70ea715cd9
commit 6937ac022c
2 changed files with 8 additions and 4 deletions

View File

@ -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>
* src/RelLib/_Person.py: prevent duplicate entries in family lists

View File

@ -72,13 +72,13 @@ class CountAncestors:
title = _("Number of ancestors of \"%s\" by generation") % person.get_primary_name().get_name()
text += title + ':\n'
thisgensize = 1
gen = 1
gen = 0
while thisgensize > 0:
thisgensize = 0
if thisgen:
thisgensize = len( thisgen )
gen -= 1
theoretical = pow(2, ( gen * -1 ) )
gen += 1
theoretical = pow(2, ( gen - 1 ) )
total_theoretical += theoretical
percent = ( thisgensize / theoretical ) * 100
if thisgensize == 1 :
@ -107,7 +107,7 @@ class CountAncestors:
else:
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")
textwindow = topDialog.get_widget("textwindow")