Author: humbedooh
Date: Wed Mar 25 01:21:32 2015
New Revision: 1669036

URL: http://svn.apache.org/r1669036
Log:
fix some bugs with DH tallying

Modified:
    steve/trunk/pysteve/lib/plugins/dh.py

Modified: steve/trunk/pysteve/lib/plugins/dh.py
URL: 
http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/plugins/dh.py?rev=1669036&r1=1669035&r2=1669036&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/plugins/dh.py (original)
+++ steve/trunk/pysteve/lib/plugins/dh.py Wed Mar 25 01:21:32 2015
@@ -54,7 +54,9 @@ def tallyDH(votes, issue):
     matrix = {}
     for key in votes:
         vote = votes[key]
-        matrix[vote] = [(matrix[vote] if vote in matrix else 0) + 1, 1]
+        if not vote in matrix:
+            matrix[vote] = [0,1]
+        matrix[vote][0] += 1
 
     # Start counting
     while len(winners) < numseats:
@@ -67,6 +69,7 @@ def tallyDH(votes, issue):
             if quotient == max(m):
                 winners.append(c)
                 matrix[c][1] += 1
+                break
 
     # Compile list of winner names
     winnernames = []


Reply via email to