You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by hu...@apache.org on 2015/03/22 22:52:50 UTC

svn commit: r1668488 - /steve/trunk/pysteve/www/cgi-bin/lib/election.py

Author: humbedooh
Date: Sun Mar 22 21:52:50 2015
New Revision: 1668488

URL: http://svn.apache.org/r1668488
Log:
YNA tallying

Modified:
    steve/trunk/pysteve/www/cgi-bin/lib/election.py

Modified: steve/trunk/pysteve/www/cgi-bin/lib/election.py
URL: http://svn.apache.org/viewvc/steve/trunk/pysteve/www/cgi-bin/lib/election.py?rev=1668488&r1=1668487&r2=1668488&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/lib/election.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/lib/election.py Sun Mar 22 21:52:50 2015
@@ -95,6 +95,15 @@ def deleteIssue(electionID, issueID):
     
 debug = []
 
+def yna(votes):
+    y,n,a = 0,0,0
+    for key in votes:
+        vote = votes[key]
+        if vote == 'y': y+=1
+        if vote == 'n': n+=1
+        if vote == 'a': a+=1
+    return y,n,a
+
 def getproportion(votes, winners, step, surplus):
     "Proportionally move votes"
     prop = {}