diff options
author | Mike Major <jmikem@bellsouth.net> | 2009-09-13 03:04:20 (GMT) |
---|---|---|
committer | Mike Major <jmikem@bellsouth.net> | 2009-09-13 03:04:20 (GMT) |
commit | 50a82ac941d2a4defb3aac0510e0ad50afc98786 (patch) | |
tree | 8f6f0584406447d02cab9bd5b8af0cffdf4acb9e | |
parent | 2c20dfb19436a568280d9ee9c986f782efc1ba14 (diff) |
add nick name to the output
-rw-r--r-- | data.py | 5 | ||||
-rw-r--r-- | hoparound.py | 8 | ||||
-rw-r--r-- | view.py | 12 |
3 files changed, 15 insertions, 10 deletions
@@ -14,10 +14,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with Foobar. If not, see <http://www.gnu.org/licenses/>. + along with HopAround. If not, see <http://www.gnu.org/licenses/>. """ -import random, math
+import random +import math
class LevelData():
def __init__(self): diff --git a/hoparound.py b/hoparound.py index d6d4b44..357ea0e 100644 --- a/hoparound.py +++ b/hoparound.py @@ -17,11 +17,12 @@ along with Foobar. If not, see <http://www.gnu.org/licenses/>. """ -from data import LevelData -from view import Views -import gtk, locale, gobject from sugar.activity import activity +from view import Views +from data import LevelData +import gtk import locale +import gobject class HopaRoundActivity(activity.Activity): def __init__(self, handle): @@ -41,7 +42,6 @@ class HopaRoundActivity(activity.Activity): self.ui.entry_click.connect("clicked", self.submit_answer, self.ui.entry_tool) self.ui.entry_tool.connect("activate", self.submit_answer, self.ui.entry_tool) self.setup(self.data, self.ui) - #sugar canvas self.set_canvas(self.ui.get_user_interaction()) self.show_all() self.ui.help.hide() @@ -14,15 +14,18 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with Foobar. If not, see <http://www.gnu.org/licenses/>. + along with HopAround. If not, see <http://www.gnu.org/licenses/>. """ -import gtk, random +import gtk +import random import locale +import sugar.profile class Views(): def __init__(self): locale.setlocale(locale.LC_ALL,"") + self.name = sugar.profile.get_nick_name() self.user_interaction = gtk.VBox() self.activity = gtk.Notebook() self.activity.set_show_tabs(False) @@ -163,7 +166,8 @@ class Views(): self.entry_tool.set_text("") def answer_correct(self, data): - text = "<big><span foreground=\"dark green\"><b>That's Right!!! =8-) </b></span> \n\n" + text = "<big><span foreground=\"dark green\"><b>That's Right, " + text += self.name + "!!! =8-) </b></span> \n\n" text += self.locl(data.random_number) + " rounded to the nearest " text += self.locl(data.answer_decade) + " is " + self.locl(data.correct_answer) if data.level_change: @@ -173,7 +177,7 @@ class Views(): self.image_output.set_from_pixbuf(self.image_correct_answer) def answer_incorrect(self, data): - text = "<big><span foreground=\"red\"><b>Sorry Charlie >:( </b></span> \n\n" + text = "<big><span foreground=\"red\"><b>Sorry " + self.name + ". >:( </b></span> \n\n" text += self.locl(data.random_number) + " rounded to the nearest " text += self.locl(data.answer_decade) + " is " + self.locl(data.correct_answer) if data.level_change: |