diff options
Diffstat (limited to 'TurtleArt/taexportpython.py')
-rw-r--r-- | TurtleArt/taexportpython.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/TurtleArt/taexportpython.py b/TurtleArt/taexportpython.py index 33c3979..9fa7b59 100644 --- a/TurtleArt/taexportpython.py +++ b/TurtleArt/taexportpython.py @@ -63,6 +63,11 @@ if __name__ == '__main__': """ _ACTION_STACK_START = """\ def %s(): +""" +_START_STACK_START_ADD = """\ + tw.start_plugins() +""" +_ACTION_STACK_PREAMBLE = """\ turtle = tw.turtles.get_active_turtle() turtles = tw.turtles canvas = tw.canvas @@ -114,12 +119,18 @@ def _action_stack_to_python(block, lc, name="start"): # wrap the action stack setup code around everything name_id = _make_identifier(name) + if name == 'start': + pre_preamble = _START_STACK_START_ADD + else: + pre_preamble = '' generated_code = _indent(generated_code, 1) if generated_code.endswith(linesep): newline = "" else: newline = linesep snippets = [_ACTION_STACK_START % (name_id), + pre_preamble, + _ACTION_STACK_PREAMBLE, generated_code, newline, _ACTION_STACK_END % (name, name_id)] |