Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/talogo.py8
-rwxr-xr-xTurtleArt/tasprite_factory.py15
-rw-r--r--TurtleArt/tawindow.py2
3 files changed, 19 insertions, 6 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index fd2751e..646b028 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -188,10 +188,14 @@ class LogoCode:
return sym
def run_blocks(self, code):
+ """Run code generated by generate_code().
+ """
self.start_time = time()
self._setup_cmd(code)
def generate_code(self, blk, blocks):
+ """ Generate code to be passed to run_blocks() from a stack of blocks.
+ """
for k in self.stacks.keys():
self.stacks[k] = None
self.stacks['stack1'] = None
@@ -855,7 +859,9 @@ class LogoCode:
def _expand_forever(self, b, blk, blocks):
""" Expand a while or until block into: forever, ifelse, stopstack
- Expand a forever block to run in a separate stack """
+ Expand a forever block to run in a separate stack
+ Parameters: the loop block, the top block, all blocks.
+ Return the start block of the expanded loop, and all blocks."""
# TODO: create a less brittle way of doing this; having to
# manage the connections and flows locally means we may run
diff --git a/TurtleArt/tasprite_factory.py b/TurtleArt/tasprite_factory.py
index 200fb78..bc2e260 100755
--- a/TurtleArt/tasprite_factory.py
+++ b/TurtleArt/tasprite_factory.py
@@ -496,13 +496,13 @@ C 36.1 12.6 43.1 20.6 43.1 30.4 Z" stroke-width="3.5" \
fill="%s" stroke="%s" />\n' % (self._fill, self._stroke)
svg += ' <path d="M 25.9 33.8 L 24.3 29.1 \
L 27.5 26.5 L 31.1 29.2 L 29.6 33.8 Z" stroke-width="3.5" \
-fill="%s" stroke="%s" />\n' % (self._fill, self._stroke)
+fill="%s" stroke="none" />\n' % (self._stroke)
svg += ' <path d="M 27.5 41.6 C 23.5 41.4 22.0 39.5 22.0 39.5 \
L 25.5 35.4 L 30.0 35.5 L 33.1 39.7 C 33.1 39.7 30.2 41.7 27.5 41.6 Z" \
-stroke-width="3.5" fill="%s" stroke="%s" />\n' % (self._fill, self._stroke)
+stroke-width="3.5" fill="%s" stroke="none" />\n' % (self._stroke)
svg += ' <path d="M 18.5 33.8 C 17.6 30.9 18.6 27.0 18.6 27.0 \
L 22.6 29.1 L 24.1 33.8 L 20.5 38.0 C 20.5 38.0 19.1 36.0 18.4 33.8 Z" \
-stroke-width="3.5" fill="%s" stroke="%s" />\n' % (self._fill, self._stroke)
+stroke-width="3.5" fill="%s" stroke="none" />\n' % (self._stroke)
svg += ' <path d="M 19.5 25.1 C 19.5 25.1 20.0 23.2 22.5 21.3 \
C 24.7 19.7 27.0 19.6 27.0 19.6 L 26.9 24.6 L 23.4 27.3 L 19.5 25.1 Z" \
stroke-width="3.5" fill="%s" stroke="none" />\n' % (self._stroke)
@@ -1224,6 +1224,14 @@ def close_file(f):
def generator(datapath):
svg = SVG()
+ f = open_file(datapath, "turtle.svg")
+ svg.set_scale(2)
+ svg_str = svg.turtle(['#00FF00','#00AA00'])
+ f.write(svg_str)
+ close_file(f)
+
+ '''
+ svg = SVG()
f = open_file(datapath, "boolean_notnot.svg")
svg.set_scale(2)
svg.expand(30, 0, 0, 0)
@@ -1248,7 +1256,6 @@ def generator(datapath):
f.write(svg_str)
close_file(f)
- '''
svg = SVG()
f = open_file(datapath, "basic.svg")
svg.set_scale(2)
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index c4bc44c..289fed7 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -347,7 +347,7 @@ class TurtleArtWindow():
pname = os.path.join(path, dirname, dirname + '.py')
if os.path.exists(pname):
plugin_files.append(dirname)
- return plugin_files
+ return plugin_files
def _init_plugins(self):
''' Try importing plugin files from the plugin dir. '''