From 4e2df4e10931eac04393c3cc8abe99953b17dcc6 Mon Sep 17 00:00:00 2001 From: Daniel Francis Date: Fri, 29 Jun 2012 21:25:58 +0000 Subject: 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 --- (limited to 'brain.py') 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 . +# You should have received a copy of the GNU General Public License +# along with HablarConSara.activity. +# If not, see . 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) -- cgit v0.9.1