Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/taprimitive.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/taprimitive.py')
-rw-r--r--TurtleArt/taprimitive.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/TurtleArt/taprimitive.py b/TurtleArt/taprimitive.py
index 7f9d76c..e59d3fd 100644
--- a/TurtleArt/taprimitive.py
+++ b/TurtleArt/taprimitive.py
@@ -488,6 +488,12 @@ class Primitive(object):
ast_list.append(new_ast)
return ast_list
+ # set turtle
+ elif self == LogoCode.prim_turtle:
+ text = 'turtle = turtles.get_active_turtle()'
+ return [get_call_ast('logo.prim_turtle', new_arg_asts),
+ ast_extensions.ExtraCode(text)]
+
# comment
elif self == Primitive.comment:
if isinstance(new_arg_asts[0], ast.Str):
@@ -1149,6 +1155,10 @@ def ast_yield_true():
return ast.Yield(value=ast.Name(id='True', ctx=ast.Load))
+def ast_turtle():
+ return ast.Turtle(value=None)
+
+
def export_me(something):
""" Return True iff this is not a Primitive or its export_me attribute
is True, i.e. everything is exportable except for Primitives with