Skip to content

Commit

Permalink
Added 0 check
Browse files Browse the repository at this point in the history
If reverts are 0, return 0, not round up to 1
  • Loading branch information
sdamashek committed Dec 31, 2012
1 parent 68102bd commit 0dcb607
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def getSummaryList():
return [(i.attributes['comment'].value+" Rev Link: http://en.wikipedia.org/w/index.php?diff="+i.attributes['revid'].value) for i in changes]
def getCounts():
sums = getSummaryList()
revert = int(round((len(([i for i in sums if classifyEdit(i)]))+1)/5.0))
rv = len(([i for i in sums if classifyEdit(i)]))
if rv == 0:
revert = 0
else:
revert = int(round((rv+1)/5.0))
total = int(round((len(sums)+1)/5.0))
return (total, revert)
def getSummaries(thatAreVandalism):
Expand Down

0 comments on commit 0dcb607

Please sign in to comment.