From 991101facb5808b750af6d9017d65f9726fc62ea Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 08 Oct 2013 12:58:48 +0000 Subject: fix label ambiguity with addturtle and turtle-label blocks --- (limited to 'plugins/turtle_blocks_extras/turtle_blocks_extras.py') diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index defd35f..ea6cc79 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -674,11 +674,11 @@ module found in the Journal')) palette.add_block('addturtle', style='basic-style-1arg', label=_('turtle'), - prim_name='turtle', + prim_name='addturtle', default=1, string_or_number=True, help_string=_('chooses which turtle to command')) - self.tw.lc.def_prim('turtle', 1, + self.tw.lc.def_prim('addturtle', 1, lambda self, x: self.tw.turtles.set_turtle(x)) @@ -1575,13 +1575,16 @@ Journal objects')) x, y = self.tw.turtles.turtle_to_screen_coordinates((x, y)) for name in block_names: # Translate label name into block/prim name. - if blkname in block_names[name]: + if blkname in block_names[name]: # block label is an array + print 'found a match', blkname, name, block_names[name] if name in content_blocks or \ (name in block_primitives and block_primitives[name] == name): + print '_make_block', blkname, name return self._make_block(name, x, y, defaults) elif blkname in block_names: - return self._make_block(blkname, x, y, defaults) + print '_make_block', blkname + return self._make_block(blkname, x, y, defaults) for name in special_names: # Translate label name into block/prim name. if blkname in special_names[name]: -- cgit v0.9.1