diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-09 13:40:21 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-09 13:40:21 (GMT) |
commit | 80d5177118d4ea9cb2e1c6a85823998888f09e06 (patch) | |
tree | ce0301fd61e6f3a70cee18e633eafd1c3559fb63 | |
parent | 2918d1cf33bcb8be74e85f8c76c48cedfa9e7543 (diff) |
rename the LogoCode's loop function to prim_loop
- The new name is more consistent with prim_if, prim_ifelse etc.
-rw-r--r-- | TurtleArt/tabasics.py | 4 | ||||
-rw-r--r-- | TurtleArt/taexportpython.py | 2 | ||||
-rw-r--r-- | TurtleArt/talogo.py | 2 | ||||
-rw-r--r-- | TurtleArt/taprimitive.py | 2 | ||||
-rw-r--r-- | plugins/turtle_blocks_extras/turtle_blocks_extras.py | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index e7ba2ff..2d16c2d 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -819,7 +819,7 @@ number of seconds')) logo_command='forever', help_string=_('loops forever')) self.tw.lc.def_prim('forever', 1, - Primitive(self.tw.lc.loop, + Primitive(self.tw.lc.prim_loop, constant_args={0: Primitive(Primitive.controller_forever, call_me=False)}), True) @@ -834,7 +834,7 @@ number of seconds')) special_name=_('repeat'), help_string=_('loops specified number of times')) self.tw.lc.def_prim('repeat', 2, - Primitive(self.tw.lc.loop, + Primitive(self.tw.lc.prim_loop, slot_wrappers={0: Primitive(Primitive.controller_repeat, slot_wrappers={0: Primitive(self.tw.lc.int, slot_wrappers={0: self.prim_cache["check_number"] diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py index 20d83af..8be59bf 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -191,7 +191,7 @@ def _walk_action_stack(top_block, lc): new_arg_asts = _walk_action_stack(conn, lc) if dock[0] == 'flow': # body of conditional or loop - if prim == LogoCode.loop: + if prim == LogoCode.prim_loop: new_arg_asts.append(_ast_yield_true()) arg_asts.append(new_arg_asts) else: diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index ed6cb7a..4512387 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -620,7 +620,7 @@ class LogoCode: if self.tw.running_turtleart: self.tw.activity.restore_state() - def loop(self, controller, blklist): + def prim_loop(self, controller, blklist): """ Execute a loop controller -- iterator that yields True iff the loop should be run once more OR a callable that returns such an iterator diff --git a/TurtleArt/taprimitive.py b/TurtleArt/taprimitive.py index 827302c..7530aa5 100644 --- a/TurtleArt/taprimitive.py +++ b/TurtleArt/taprimitive.py @@ -290,7 +290,7 @@ class Primitive(object): # SPECIAL HANDLING # # loops - if self == LogoCode.loop: + if self == LogoCode.prim_loop: controller = self._get_loop_controller() if controller == Primitive.controller_repeat: # 'repeat' loop diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index f625b14..b618d9e 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -102,7 +102,7 @@ class Turtle_blocks_extras(Plugin): 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, + Primitive(self.tw.lc.prim_loop, slot_wrappers={0: Primitive(Primitive.controller_while)}), True) @@ -117,7 +117,7 @@ boolean operators from Numbers palette')) 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, + Primitive(self.tw.lc.prim_loop, slot_wrappers={0: Primitive(Primitive.controller_until)}), True) |