From d4f44b1e52be6bce700c76a893fcee0f6f610b63 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 06 Nov 2013 13:53:42 +0000 Subject: Alan's pyflakes cleanup and new strategy for translating palette names --- (limited to 'pysamples') 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'), -- cgit v0.9.1