Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-01-04 15:46:02 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-02-13 01:51:49 (GMT)
commitd563587a2b4fc82a4a181466fb00849f964b7933 (patch)
treeb5fecdc83eeb6adaaa48af2924921586a0ee40c1
parent079ffc93fa290778a94f58224d0d848ebcfdf697 (diff)
do not share values between various polls
-rw-r--r--poll.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/poll.py b/poll.py
index 9faf5da..c2cd6b8 100644
--- a/poll.py
+++ b/poll.py
@@ -1134,9 +1134,7 @@ class Poll:
"""Represent the data of one poll."""
def __init__(self, activity=None, title='', author='', active=False,
createdate=date.today(), maxvoters=20, question='',
- number_of_options=5,
- options={0: '', 1: '', 2: '', 3: '', 4: ''},
- data={0:0, 1:0, 2:0, 3:0, 4:0}, votes={'foo': 0}):
+ number_of_options=5, options=None, data=None, votes=None):
"""Create the Poll."""
self.activity = activity
self.title = title
@@ -1146,9 +1144,9 @@ class Poll:
self.maxvoters = maxvoters
self.question = question
self.number_of_options = number_of_options
- self.options = options
- self.data = data
- self.votes = votes
+ self.options = (options or {0: '', 1: '', 2: '', 3: '', 4: ''})
+ self.data = (data or {0:0, 1:0, 2:0, 3:0, 4:0})
+ self.votes = (votes or {})
self._logger = logging.getLogger('poll-activity.Poll')
self._logger.debug('Creating Poll(%s by %s)' % (title, author))