Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/brain.py
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-06-29 21:25:58 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2012-06-30 04:13:22 (GMT)
commit4e2df4e10931eac04393c3cc8abe99953b17dcc6 (patch)
tree2248b9dda4744b1b9e1a2e48e2f1eb325c887ea9 /brain.py
parenta8630e53fe8077e684652b240c236ccba807838d (diff)
A lot of pep8 corrections
I'm porting Speak Activity to Gtk3, this patch is the first step. I have these pending steps to do: . Remove the toolkit modules and migrate the activity to sugar-toolkit . Migrate from Hippo to Gtk . Convert the activity to PyGI; Gtk3 Port Start . Use gi.repository.Gst in the place of pygst . Extra corrections; Finishing port Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'brain.py')
-rw-r--r--brain.py46
1 files changed, 24 insertions, 22 deletions
diff --git a/brain.py b/brain.py
index 5223f4b..8a7d5e7 100644
--- a/brain.py
+++ b/brain.py
@@ -1,21 +1,23 @@
# HablarConSara.activity
# A simple hack to attach a chatterbot to speak activity
-# Copyright (C) 2008 Sebastian Silva Fundacion FuenteLibre sebastian@fuentelibre.org
+# Copyright (C) 2008
+# Sebastian Silva Fundacion FuenteLibre sebastian@fuentelibre.org
#
# Style and structure taken from Speak.activity Copyright (C) Joshua Minor
#
-# HablarConSara.activity is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# HablarConSara.activity is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# HablarConSara.activity is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# HablarConSara.activity is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
-# along with HablarConSara.activity. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License
+# along with HablarConSara.activity.
+# If not, see <http://www.gnu.org/licenses/>.
import gtk
import gobject
@@ -29,15 +31,14 @@ from toolkit.combobox import ComboBox
import aiml
import voice
-BOTS = {
- _('Spanish'): { 'name': 'Sara',
- 'brain': 'bot/sara.brn',
- 'predicates': { 'nombre_bot': 'Sara',
- 'botmaster': 'La comunidad Azucar' } },
- _('English'): { 'name': 'Alice',
- 'brain': 'bot/alice.brn',
- 'predicates': { 'name': 'Alice',
- 'master': 'The Sugar Community' } } }
+BOTS = {_('Spanish'): {'name': 'Sara',
+ 'brain': 'bot/sara.brn',
+ 'predicates': {'nombre_bot': 'Sara',
+ 'botmaster': 'La comunidad Azucar'}},
+ _('English'): {'name': 'Alice',
+ 'brain': 'bot/alice.brn',
+ 'predicates': {'name': 'Alice',
+ 'master': 'The Sugar Community'}}}
def get_mem_info(tag):
@@ -122,8 +123,9 @@ def load(activity, voice, sorry=None):
activity.set_cursor(old_cursor)
if is_first_session:
- hello = _("Hello, I'm a robot \"%s\". Please ask me any question.") \
- % BOTS[voice.friendlyname]['name']
+ hello = _("Hello, I'm a robot \"%s\". " +\
+ "Please ask me any question.") %\
+ BOTS[voice.friendlyname]['name']
if sorry:
hello += ' ' + sorry
activity.face.say_notification(hello)