diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-11-18 12:24:53 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-11-18 12:24:53 (GMT) |
commit | 5e25590c74218d315bdd73ad918df74cb0e39fe5 (patch) | |
tree | 7668037af332b34a5bb940241612ea100eaf5c5d | |
parent | 4a5ef51bb341bc1f81f107b5475d3bf32d312127 (diff) |
show status messages instead of printing to log file
-rw-r--r-- | pysamples/brain.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pysamples/brain.py b/pysamples/brain.py index 5a2c0c4..cc43bbb 100644 --- a/pysamples/brain.py +++ b/pysamples/brain.py @@ -32,7 +32,8 @@ def myblock(tw, text): import os from gettext import gettext as _ if not os.path.exists(SPEAKPATH): - tw.lc.heap.append(_('Please install the Speak Activity and try again.')) + tw.showlabel( + 'status', _('Please install the Speak Activity and try again.')) return import sys sys.path.append(SPEAKPATH) @@ -77,7 +78,10 @@ def myblock(tw, text): if kernel is not None: text = kernel.respond(text) if kernel is None or not text: - text = "" + text = '' + tw.showlabel( + 'status', + _("Sorry, I can't understand what you are asking about.")) return text def brain_load(kernel, voice): @@ -85,8 +89,9 @@ def myblock(tw, text): kernel = aiml.Kernel() if brain['brain'] is None: - print "Sorry, there is no free memory to load my brain. \ -Close other activities and try once more." + tw.showlabel( + 'status', _('Sorry, there is no free memory to load my brain. \ +Close other activities and try once more.')) return kernel kernel.loadBrain(brain['brain']) |