From dfe3551ce2094f9f7787ff60f9d984e33638bda4 Mon Sep 17 00:00:00 2001 From: James Scott Date: Sun, 16 Dec 2012 20:13:20 -0500 Subject: [PATCH] prettier lists --- plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index 90c5c45..1ca9db0 100644 --- a/plugin.py +++ b/plugin.py @@ -106,17 +106,18 @@ class Cah(callbacks.Plugin): def _tallyVotes(self, votes): ties = [] - winningCanidate = None + winningCanidate = [] canidatesById = [] for nick in self.cardsPlayed.keys(): canidatesById.append(nick) for canidateNumber, count in votes.iteritems(): canidate = canidatesById[canidateNumber] - if len(winningCanidate) == None: - winningCanidate = [(canidate, count), ] + if len(winningCanidate) == 0: + winningCanidate.append(canidate, count)) elif winningCanidate[0][1] < count: - winningCanidate = ((canidate, count), ] + winningCanidate = [] + winningCanidate.append((canidate, count)) elif winningCanidate[0][1] == count: winningCanidate.append((canidate, count))