Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pysamples/brain.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysamples/brain.py')
-rw-r--r--pysamples/brain.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pysamples/brain.py b/pysamples/brain.py
index d2615bf..456df37 100644
--- a/pysamples/brain.py
+++ b/pysamples/brain.py
@@ -29,14 +29,16 @@ def myblock(tw, text):
# The AIML library is bundled with the Speak activity
SPEAKPATHS = ['/home/olpc/Activities/Speak.activity',
+ '/home/liveuser/Activities/Speak.activity',
'/usr/share/sugar/activities/Speak.activity']
import os
from gettext import gettext as _
- if os.path.exists(SPEAKPATHS[0]):
- speakpath = SPEAKPATHS[0]
- elif os.path.exists(SPEAKPATHS[1]):
- speakpath = SPEAKPATHS[1]
- else:
+ speakpath = None
+ for sp in SPEAKPATHS:
+ if os.path.exists(sp):
+ speakpath = sp
+ break
+ if speakpath is None:
tw.showlabel(
'status', _('Please install the Speak Activity and try again.'))
return