Subversion Repositories Remote Hare Voting

Rev

Rev 35 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35 Rev 38
Line 9... Line 9...
9
#
9
#
10
# output: list of lists of ballots
10
# output: list of lists of ballots
11
#       [[1stcandbal1, 2ndcandbal1, ...], [1stcandbal2, 2ndcandbal2, ...], ...]
11
#       [[1stcandbal1, 2ndcandbal1, ...], [1stcandbal2, 2ndcandbal2, ...], ...]
12
 
12
 
13
def parsestring(contents):
13
def parsestring(contents):
14
    lines = string.split(contents, "\n")
14
    lines = contents.splitlines()
15
    fields = string.split(lines[0], ",")
15
    fields = string.split(lines[0], ",")
16
    nWinners = int(fields[0])
16
    nWinners = int(fields[0])
17
 
17
 
18
    votes = []
18
    votes = []
19
    for line in lines[1:]:
19
    for line in lines[1:]: