Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2013-08-19 21:12:46 (GMT)
committer Philip Withnall <philip@tecnocode.co.uk>2013-08-19 21:12:46 (GMT)
commit5cc02b29babc05198c6417c131f3a735d052da2a (patch)
tree952266624b9430e91dca2a652fd8e4830ca09b5e
parent51385bb99f2659c94213e65a476baf84628685d3 (diff)
Fix variable shadowing
-rwxr-xr-xPascalTriangle.activity/pascaltriangle.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/PascalTriangle.activity/pascaltriangle.py b/PascalTriangle.activity/pascaltriangle.py
index d779432..bda6cf5 100755
--- a/PascalTriangle.activity/pascaltriangle.py
+++ b/PascalTriangle.activity/pascaltriangle.py
@@ -422,18 +422,19 @@ class PascalTriangleActivity(activity.Activity):
class NewGameButton(ToolButton):
- def __init__(self, activity, **kwargs):
+ def __init__(self, parent_activity, **kwargs):
ToolButton.__init__(self, 'add', **kwargs)
self.props.tooltip = _('New Game')
self.props.accelerator = '<Ctrl>N'
- self.connect('clicked', self.__new_game_button_clicked_cb, activity)
+ self.connect('clicked', self.__new_game_button_clicked_cb,
+ parent_activity)
- def __new_game_button_clicked_cb(self, button, activity):
- activity._start_game()
+ def __new_game_button_clicked_cb(self, button, parent_activity):
+ parent_activity._start_game()
class HintButton(ToggleToolButton):
- def __init__(self, activity, **kwargs):
+ def __init__(self, parent_activity, **kwargs):
ToggleToolButton.__init__(self, 'show-hints', **kwargs)
#self.props.tooltip = 'Show Hints'
self.set_tooltip(_('Show Hints'))
@@ -441,7 +442,7 @@ class HintButton(ToggleToolButton):
# Add an accelerator. In later versions of Sugar, we can just set the
# 'accelerator' property instead.
#self.props.accelerator = '<Ctrl>H'
- accel_group = activity.get_toplevel().sugar_accel_group
+ accel_group = parent_activity.get_toplevel().sugar_accel_group
keyval, mask = Gtk.accelerator_parse('<Ctrl>H')
# the accelerator needs to be set at the child, so the Gtk.AccelLabel
# in the palette can pick it up.
@@ -449,7 +450,7 @@ class HintButton(ToggleToolButton):
self.get_child().add_accelerator('clicked', accel_group,
keyval, mask, accel_flags)
- self.connect('clicked', self.__hint_button_clicked_cb, activity)
+ self.connect('clicked', self.__hint_button_clicked_cb, parent_activity)
- def __hint_button_clicked_cb(self, button, activity):
- activity.show_hints = self.get_active()
+ def __hint_button_clicked_cb(self, button, parent_activity):
+ parent_activity.show_hints = self.get_active()