projects
/
quizzer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
465d497
)
ui.cli: Don't record EOF or blank entries as answers
author
W. Trevor King
<wking@tremily.us>
Fri, 22 Mar 2013 15:27:45 +0000
(11:27 -0400)
committer
W. Trevor King
<wking@tremily.us>
Fri, 22 Mar 2013 15:27:45 +0000
(11:27 -0400)
If the user closes stdin, don't check and see if 'EOF' is an allowed
answer, just exit the QuestionCommandLine loop. Don't try to process
blank entries either, just re-ask the question.
quizzer/ui/cli.py
patch
|
blob
|
history
diff --git
a/quizzer/ui/cli.py
b/quizzer/ui/cli.py
index cbfa16df3be4cef7a8e968161e191ce66361c642..14ae67f97242254d4d70b7b86d20fcb73c2360ab 100644
(file)
--- a/
quizzer/ui/cli.py
+++ b/
quizzer/ui/cli.py
@@
-122,6
+122,10
@@
class QuestionCommandLine (_cmd.Cmd):
answer = self.answers[0]
else:
answer = ''
+ if answer == 'EOF':
+ return True # quit
+ if answer == '':
+ return
kwargs = {}
if self._tempdir:
kwargs['tempdir'] = self._tempdir