[orca] Fix for speech keybindings failing when no speech settings have been saved
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for speech keybindings failing when no speech settings have been saved
- Date: Fri, 18 May 2012 18:22:14 +0000 (UTC)
commit f0cc50d61fdab8e07c21d8a00b56ff9cbc94ea9b
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri May 18 14:22:35 2012 -0400
Fix for speech keybindings failing when no speech settings have been saved
src/orca/speechdispatcherfactory.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 47f0928..a7f0d9d 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -382,7 +382,10 @@ class SpeechServer(speechserver.SpeechServer):
def _change_default_speech_rate(self, decrease=False):
acss = settings.voices[settings.DEFAULT_VOICE]
delta = settings.speechRateDelta * (decrease and -1 or +1)
- rate = acss[ACSS.RATE]
+ try:
+ rate = acss[ACSS.RATE]
+ except KeyError:
+ rate = 50
acss[ACSS.RATE] = max(0, min(99, rate + delta))
debug.println(debug.LEVEL_CONFIGURATION,
"Speech rate is now %d" % rate)
@@ -392,7 +395,10 @@ class SpeechServer(speechserver.SpeechServer):
def _change_default_speech_pitch(self, decrease=False):
acss = settings.voices[settings.DEFAULT_VOICE]
delta = settings.speechPitchDelta * (decrease and -1 or +1)
- pitch = acss[ACSS.AVERAGE_PITCH]
+ try:
+ pitch = acss[ACSS.AVERAGE_PITCH]
+ except KeyError:
+ pitch = 5
acss[ACSS.AVERAGE_PITCH] = max(0, min(9, pitch + delta))
debug.println(debug.LEVEL_CONFIGURATION,
"Speech pitch is now %d" % pitch)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]