Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-02 21:08:09 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-02 21:08:09 (GMT)
commit9d88c67484dad057410ec7d5fe8bf2b7cdedba45 (patch)
treeff30977d2ae210e408f5cc7a5f44f73ff5d02c8c /TurtleArt/tautils.py
parent609dfa7b066a67c8c6cd542b4735a1e8ebb42131 (diff)
Add box and stack proto blocks to palette on load/copy; Don't create duplicate start or action blocks with copy/paste
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 862554b..6871f35 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -1,4 +1,4 @@
-#Copyright (c) 2007-8, Playful Invention Company.
+#copyright (c) 2007-8, Playful Invention Company.
#Copyright (c) 2008-12, Walter Bender
#Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -766,6 +766,8 @@ def find_top_block(blk):
''' Find the top block in a stack. '''
if blk is None:
return None
+ if blk.connections is None:
+ return blk
if len(blk.connections) == 0:
return blk
while blk.connections[0] is not None:
@@ -777,6 +779,8 @@ def find_bot_block(blk):
''' Find the bottom block in a stack. '''
if blk is None:
return None
+ if blk.connections is None:
+ return blk
if len(blk.connections) == 0:
return blk
while blk.connections[-1] is not None: