Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/taexportlogo.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-11-16 14:46:11 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-11-16 14:46:11 (GMT)
commit3c36b15735c3313a76e08f1f162b278adfa8ba42 (patch)
tree576700d8536c75c66529681c86bffa393eef1763 /TurtleArt/taexportlogo.py
parent7ebe6872eba46296baa4d2a04b263f915d2aa2af (diff)
cleaned up encapsulation problem
Diffstat (limited to 'TurtleArt/taexportlogo.py')
-rw-r--r--TurtleArt/taexportlogo.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/TurtleArt/taexportlogo.py b/TurtleArt/taexportlogo.py
index 3f4e625..bfa7ca8 100644
--- a/TurtleArt/taexportlogo.py
+++ b/TurtleArt/taexportlogo.py
@@ -22,7 +22,6 @@ IGNORE = ["hideblocks", "showblocks", "fullscreen", "polar", "cartesian",
"sandwichbottom", "id"]
import math
-from tautils import walk_stack
try:
from sugar.datastore import datastore
except:
@@ -127,7 +126,7 @@ tasetshade :shade \r"
"""
for b in bs:
this_stack = ""
- data = walk_stack(tw, b)
+ data = walk_stack(tw.lc, b, tw.block_list.list)
# We need to catch several special cases: stacks, random, etc.
stack = False
namedstack = False
@@ -356,3 +355,15 @@ tasetshade :shade \r"
"make \"taheap []\r" + code
code = "window\r" + code
return code
+
+
+def walk_stack(lc, blk, list):
+ """ Convert blocks to logo psuedocode. """
+ from tautils import find_top_block
+
+ top = find_top_block(blk)
+ if blk == top:
+ code = lc.run_blocks(top, list, False)
+ return code
+ else:
+ return []