From 5e25590c74218d315bdd73ad918df74cb0e39fe5 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 18 Nov 2012 12:24:53 +0000 Subject: show status messages instead of printing to log file --- 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']) -- cgit v0.9.1