readabilite: spread score to all ancestors

Instead of just parents and grandparents
master
pictuga 2017-03-18 22:24:38 -10:00
parent e3ab3c6823
commit 367f86987d
1 changed files with 7 additions and 7 deletions

View File

@ -88,13 +88,13 @@ def score_all(root):
grades[item] = score
parent = item.getparent()
if parent is not None:
grades[parent] += score / 2.
gdparent = parent.getparent()
if gdparent is not None:
grades[gdparent] += score / 4.
factor = 2
for ancestor in item.iterancestors():
if score / factor > 1:
grades[ancestor] += score / factor
factor *= 2
else:
break
return grades