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/23 09:20:59 UTC
svn commit: r1668537 - /steve/trunk/pysteve/www/cgi-bin/lib/election.py
Author: humbedooh
Date: Mon Mar 23 08:20:58 2015
New Revision: 1668537
URL: http://svn.apache.org/r1668537
Log:
bit more debug info
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=1668537&r1=1668536&r2=1668537&view=diff
==============================================================================
--- steve/trunk/pysteve/www/cgi-bin/lib/election.py (original)
+++ steve/trunk/pysteve/www/cgi-bin/lib/election.py Mon Mar 23 08:20:58 2015
@@ -192,7 +192,8 @@ def stv(candidates, votes, numseats):
# Find quota to win a seat
quota = ( len(votes) / (numseats + 1) ) + 1
- debug.append("Votes required to win a seat: %u" % quota)
+ debug.append("Seats available: %u. Votes cast: %u" % (numseats, len(votes)))
+ debug.append("Votes required to win a seat: %u ( (%u/(%u+1))+1 )" % (quota, len(votes), numseats))
# While we still have seats to fill
if not len(candidates) < numseats: