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/25 13:34:49 UTC

svn commit: r1669106 - in /steve/trunk/pysteve/lib: constants.py election.py

Author: humbedooh
Date: Wed Mar 25 12:34:48 2015
New Revision: 1669106

URL: http://svn.apache.org/r1669106
Log:
add a method for fetching vote type info
set N to 10 instead of 20 for now

Modified:
    steve/trunk/pysteve/lib/constants.py
    steve/trunk/pysteve/lib/election.py

Modified: steve/trunk/pysteve/lib/constants.py
URL: http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/constants.py?rev=1669106&r1=1669105&r2=1669106&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/constants.py (original)
+++ steve/trunk/pysteve/lib/constants.py Wed Mar 25 12:34:48 2015
@@ -21,4 +21,4 @@ VOTE_TYPES = (
 
 # For vote types with N number of seats/spots, this value denotes
 # the max number of useable types to display via the API
-MAX_NUM = 20
\ No newline at end of file
+MAX_NUM = 10
\ No newline at end of file

Modified: steve/trunk/pysteve/lib/election.py
URL: http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/election.py?rev=1669106&r1=1669105&r2=1669106&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/election.py (original)
+++ steve/trunk/pysteve/lib/election.py Wed Mar 25 12:34:48 2015
@@ -137,6 +137,12 @@ def listElections():
         elections = [f for f in os.listdir(path) if os.path.isdir(os.path.join(path, f))]
     return elections
 
+def getVoteType(issue):
+    for voteType in constants.VOTE_TYPES:
+        if voteType['key'] == issue['type']:
+            return voteType
+    return {}
+
 def vote(electionID, issueID, voterID, vote):
     "Casts a vote on an issue"
     votes = {}