Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-08-07 11:31:43 (GMT)
committer Marion <marion.zepf@gmail.com>2013-08-07 11:31:43 (GMT)
commit5fc1c13ca41bbb1832b4257d9e9b032b3abd287d (patch)
tree5baa433ae3e85f5f4291034f0c185f61fcc3df9a /plugins
parentd7da80ca0f67617d5c305aed1ef66e12e4d43e69 (diff)
add Primitives for the 'pen state', 'while', and 'until' blocks
- The Primitives for the 'while' and 'until' blocks are only used to export the blocks, not for running them.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 8f5a94d..f625b14 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -38,6 +38,7 @@ from TurtleArt.tautils import (round_int, debug_output, get_path,
data_to_string, find_group, image_to_base64,
hat_on_top, listify, data_from_file)
from TurtleArt.tajail import (myfunc, myfunc_import)
+from TurtleArt.taprimitive import Primitive
def _num_type(x):
@@ -99,6 +100,11 @@ class Turtle_blocks_extras(Plugin):
special_name=_('while'),
help_string=_('do-while-True operator that uses \
boolean operators from Numbers palette'))
+ # Primitive is only used for exporting this block, not for running it
+ self.tw.lc.def_prim('while', 2,
+ Primitive(self.tw.lc.loop,
+ slot_wrappers={0: Primitive(Primitive.controller_while)}),
+ True)
# internally expanded macro
palette.add_block('until',
@@ -109,6 +115,11 @@ boolean operators from Numbers palette'))
special_name=_('until'),
help_string=_('do-until-True operator that uses \
boolean operators from Numbers palette'))
+ # Primitive is only used for exporting this block, not for running it
+ self.tw.lc.def_prim('until', 2,
+ Primitive(self.tw.lc.loop,
+ slot_wrappers={0: Primitive(Primitive.controller_until)}),
+ True)
primitive_dictionary['clamp'] = self._prim_clamp
palette.add_block('sandwichclamp',