[orca] Fix for bgo#596340 - Exception if no selection is given when choosing a language
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [orca] Fix for bgo#596340 - Exception if no selection is given when choosing a language
- Date: Mon, 19 Oct 2009 16:26:09 +0000 (UTC)
commit 378260c37f5dc7e4da317a5612d824c8e84c7d95
Author: Willie Walker <william walker sun com>
Date: Mon Oct 19 12:25:12 2009 -0400
Fix for bgo#596340 - Exception if no selection is given when choosing a language
src/orca/orca_console_prefs.py | 43 +++++++++++++++++++++++++++------------
1 files changed, 30 insertions(+), 13 deletions(-)
---
diff --git a/src/orca/orca_console_prefs.py b/src/orca/orca_console_prefs.py
index d841e3d..de54b3d 100644
--- a/src/orca/orca_console_prefs.py
+++ b/src/orca/orca_console_prefs.py
@@ -171,7 +171,12 @@ def setupSpeech(prefsDict):
# Translators: this is prompting for a numerical choice.
#
- choice = int(sayAndPrint(_("Enter choice: "), False, True))
+ while True:
+ try:
+ choice = int(sayAndPrint(_("Enter choice: "), False, True))
+ break
+ except:
+ pass
if (choice <= 0) or (choice >= i):
# Translators: this means speech synthesis will not be used.
#
@@ -203,7 +208,12 @@ def setupSpeech(prefsDict):
# Translators: this is prompting for a numerical choice.
#
- choice = int(sayAndPrint(_("Enter choice: "), False, True))
+ while True:
+ try:
+ choice = int(sayAndPrint(_("Enter choice: "), False, True))
+ break
+ except:
+ pass
if (choice <= 0) or (choice >= i):
# Translators: this means speech synthesis will not be used.
#
@@ -250,10 +260,15 @@ def setupSpeech(prefsDict):
# Translators: this is prompting for a numerical choice.
#
- choice = int(sayAndPrint(_("Enter choice: "),
- False, # stop
- True, # getInput
- speechServerChoice)) # speech server
+ while True:
+ try:
+ choice = int(sayAndPrint(_("Enter choice: "),
+ False, # stop
+ True, # getInput
+ speechServerChoice)) # speech server
+ break
+ except:
+ pass
if (choice <= 0) or (choice >= i):
# Translators: this means speech synthesis will not be used.
#
@@ -396,13 +411,15 @@ def setupSpeech(prefsDict):
sayAndPrint(_("2. Laptop"),
False, False, speechServerChoice, speechVoiceChoice)
- try:
- # Translators: this is prompting for a numerical choice.
- #
- choice = int(sayAndPrint(_("Enter choice: "),
- False, True, speechServerChoice, speechVoiceChoice))
- except:
- choice = -1
+ while True:
+ try:
+ # Translators: this is prompting for a numerical choice.
+ #
+ choice = int(sayAndPrint(_("Enter choice: "),
+ False, True, speechServerChoice, speechVoiceChoice))
+ break
+ except:
+ pass
if choice == 2:
prefsDict["keyboardLayout"] = settings.GENERAL_KEYBOARD_LAYOUT_LAPTOP
prefsDict["orcaModifierKeys"] = settings.LAPTOP_MODIFIER_KEYS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]