From 686f3c89c2297dcbcfa2dd986220beae00fa61b8 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 20 Nov 2012 20:14:22 +0000 Subject: add liveuser to path for Speak.activity --- 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 -- cgit v0.9.1