Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readactivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-03-06 15:41:38 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-03-06 16:38:49 (GMT)
commit405e436dfb4e2dbd074b6feb6d9b734afc118678 (patch)
treeceed0e9f4bb852cff9cbac9e9b4be76a6f7a41c0 /readactivity.py
parent82581babd0c1c969ee6de0ed53eb7a82415fa545 (diff)
Only init the speech service if the backend support text to speech
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'readactivity.py')
-rw-r--r--readactivity.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/readactivity.py b/readactivity.py
index 447c160..38a5ee9 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -53,7 +53,6 @@ from readtoolbar import SpeechToolbar
from readsidebar import Sidebar
from readtopbar import TopBar
from readdb import BookmarkManager
-import speech
from sugarmenuitem import SugarMenuItem
_HARDWARE_MANAGER_INTERFACE = 'org.laptop.HardwareManager'
@@ -834,9 +833,11 @@ class ReadActivity(activity.Activity):
self._view_toolbar._update_zoom_buttons()
if not self._view.can_highlight():
self._highlight_item.hide()
- if speech.supported and self._view.can_do_text_to_speech():
- self.speech_toolbar_button.show()
- self.speech_toolbar_button.show()
+ if self._view.can_do_text_to_speech():
+ import speech
+ if speech.supported:
+ self.speech_toolbar_button.show()
+ self.speech_toolbar_button.show()
def _share_document(self):
"""Share the document."""