diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-11-20 20:14:22 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-11-20 20:14:22 (GMT) |
commit | 686f3c89c2297dcbcfa2dd986220beae00fa61b8 (patch) | |
tree | 5e352e829f5cb192c31ec5fe44071b7fff6f6d47 | |
parent | b5b4cd362a6ac4818cecd4308467766fd721647f (diff) |
add liveuser to path for Speak.activity
-rw-r--r-- | pysamples/brain.py | 12 |
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 |