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 grades[item] = score
parent = item.getparent() factor = 2
if parent is not None: for ancestor in item.iterancestors():
grades[parent] += score / 2. if score / factor > 1:
grades[ancestor] += score / factor
gdparent = parent.getparent() factor *= 2
if gdparent is not None: else:
grades[gdparent] += score / 4. break
return grades return grades