Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pysamples/uturn.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysamples/uturn.py')
-rw-r--r--pysamples/uturn.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pysamples/uturn.py b/pysamples/uturn.py
index f6ff2e0..60683a0 100644
--- a/pysamples/uturn.py
+++ b/pysamples/uturn.py
@@ -1,4 +1,4 @@
-#Copyright (c) 2011-2013, Walter Bender
+ #Copyright (c) 2011-2013, Walter Bender
# This procedure is invoked when the user-definable block on the
# "extras" palette is selected.
@@ -23,7 +23,7 @@ def myblock(tw, args):
tw.lc.update_label_value('heading', value)
from TurtleArt.tapalette import make_palette, palette_name_to_index
- from TurtleArt.talogo import primitive_dictionary
+ from TurtleArt.taprimitive import Primitive, ConstantArg
from gettext import gettext as _
# Choose a palette for the new block.
@@ -37,7 +37,7 @@ def myblock(tw, args):
help_string=_('turns the turtle 180 degrees'))
# Add its primitive to the LogoCode dictionary.
- tw.lc.def_prim('uturn', 0, lambda self: _prim_uturn(tw))
+ tw.lc.def_prim('uturn', 0, Primitive(_prim_uturn, arg_descs=[ConstantArg(tw)]))
# Regenerate the palette, which will now include the new block.
tw.show_toolbar_palette(palette_name_to_index('turtle'),