Author: humbedooh
Date: Wed Mar 25 13:47:02 2015
New Revision: 1669125
URL: http://svn.apache.org/r1669125
Log:
some more comments
Modified:
steve/trunk/pysteve/lib/plugins/cop.py
Modified: steve/trunk/pysteve/lib/plugins/cop.py
URL:
http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/plugins/cop.py?rev=1669125&r1=1669124&r2=1669125&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/plugins/cop.py (original)
+++ steve/trunk/pysteve/lib/plugins/cop.py Wed Mar 25 13:47:02 2015
@@ -120,10 +120,13 @@ def tallyCOP(votes, issue):
surplus = 0
movedOn = False
for candidate in parties[party]['candidates']:
+ # If a candidate has not yet been elected, and has >=
votes than the required quota, elect her/him
if not candidate['elected'] and numseats > len(winners):
if candidate['votes'] >= quota:
candidate['elected'] = True
winners.append("%s (%s) %u" % ( candidate['name'],
parties[party]['name'], candidate['votes']))
+
+ # Did X receive more votes than needed? if so, add
back to the party surplus
surplus += candidate['votes'] - quota
# If surplus of votes, add it to the next candidate in the
same party