diff options
author | Marion <marion.zepf@gmail.com> | 2013-07-23 09:01:44 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-07-23 09:01:44 (GMT) |
commit | 1071c82c317933a3251fe0c0c5028afbb5615e73 (patch) | |
tree | 88d2cd2fec8da3c3296681e41faaec13f6ae7b1a /TurtleArt/taexportpython.py | |
parent | 75271bb387a70a047b3258813d55e1e517c5bd44 (diff) |
define some Primitives as not exportable when they are created
Diffstat (limited to 'TurtleArt/taexportpython.py')
-rw-r--r-- | TurtleArt/taexportpython.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py index 11033a7..1f7fb82 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -129,7 +129,12 @@ def _walk_action_stack(top_block, lc): # TODO fail gracefully if primitive is not a Primitive object if not isinstance(prim, Primitive): raise TypeError("cannot export block " + repr(block)) - ast_list.append(prim.get_ast(*arg_asts)) + if prim.export_me: + new_ast = prim.get_ast(*arg_asts) + ast_list.append(new_ast) + elif arg_asts: + new_ast = ast.List(elts=arg_asts, ctx=ast.Load) + ast_list.append(new_ast) # skip the very first dock/ connection - it's either the previous block or # the return value of this block |