diff options
author | Marion <marion.zepf@gmail.com> | 2013-07-31 20:28:49 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-07-31 20:28:49 (GMT) |
commit | f482dbfc1bb2c082d5a5356fd17dd517b0002b7b (patch) | |
tree | 1000331ffc8f67a268d6ad57cd1322954d4ede45 /TurtleArt/taexportpython.py | |
parent | bfecbdb82325131758e294e2175531c193d30324 (diff) |
add Primitive object for 'clean' block
- add function that groups together several Primitive objects as
if they were consecutive lines of code
Diffstat (limited to 'TurtleArt/taexportpython.py')
-rw-r--r-- | TurtleArt/taexportpython.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py index 1f7fb82..85d5295 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -131,7 +131,10 @@ def _walk_action_stack(top_block, lc): raise TypeError("cannot export block " + repr(block)) if prim.export_me: new_ast = prim.get_ast(*arg_asts) - ast_list.append(new_ast) + if isinstance(new_ast, (list, tuple)): + ast_list.extend(new_ast) + else: + ast_list.append(new_ast) elif arg_asts: new_ast = ast.List(elts=arg_asts, ctx=ast.Load) ast_list.append(new_ast) |