Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #257 from ericolito/vote_script
Browse files Browse the repository at this point in the history
Return value fix (1.2)
  • Loading branch information
jquast committed Feb 27, 2015
2 parents ebc4bab + d2cd483 commit 5b71032
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
2.0.8
- bugfix: Fixed a nasty Return value bug in vote.py that could
cause a database failure.
- bugfix: XML element tag name in weather.py AccuWeather response now
includes namespace
- bugfix: Refresh screen error in msgarea.py
Expand Down
8 changes: 4 additions & 4 deletions x84/default/vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
databasename = 'votingbooth' # change this to use an alternative database file

__author__ = 'Hellbeard'
__version__ = 1.1
__version__ = 1.2

# -----------------------------------------------------------------------------------

Expand Down Expand Up @@ -184,7 +184,7 @@ def vote(questionnumber):
term.move(0, 0) + term.white(u'Your answer: '))
le = LineEditor(48)
new_alternative = le.read()
if new_alternative == '':
if new_alternative == '' or new_alternative == None:
return
results[(questionnumber, int(inp))] = 0 # init..
# init..
Expand Down Expand Up @@ -236,7 +236,7 @@ def add_question():
echo(term.clear + term.white + u'\r\nQuestion: ')
le = LineEditor(65)
new_question = le.read()
if new_question == '':
if new_question == '' or new_question == None:
return

echo(term.bold_black(u'\r\n\r\nLeave a blank line when you are finished..'))
Expand All @@ -246,7 +246,7 @@ def add_question():
term.red + str(new_amount) + term.white + u': ')
le = LineEditor(48)
alternatives[(amount_of_questions, new_amount)] = le.read()
if alternatives[(amount_of_questions, new_amount)] == '':
if alternatives[(amount_of_questions, new_amount)] == '' or alternatives[(amount_of_questions, new_amount)] == None :
break
else:
results[(amount_of_questions, new_amount)] = 0
Expand Down

0 comments on commit 5b71032

Please sign in to comment.