Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-09-02 03:57:51 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-09-02 03:57:51 (GMT)
commitd0d56570ac006a388ae350a5213d6e37ec9aff96 (patch)
tree15e56b3620bcbb77b53f0cdb1b78f675999d76c4 /TurtleArt/tawindow.py
parent1ddb7dc365e4302df39178e106e10b2c62b51c79 (diff)
one more corner case re renaming action blocks
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index dcb43a5..3f1f4ca 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1320,7 +1320,21 @@ class TurtleArtWindow():
elif blk.name in ['hat']:
similars = self.block_list.get_similar_blocks(
'block', blk.name)
- if len(similars) > 0:
+ # First look for a hat with _('action') as its label
+ found_the_action_block = False
+ bname = _('action')
+ if type(bname) == unicode:
+ bname = bname.encode('ascii', 'replace')
+ for sblk in similars:
+ cblk = sblk.connections[1]
+ if cblk is not None:
+ blabel = cblk.spr.labels[0]
+ if type(blabel) == unicode:
+ blabel = blabel.encode('ascii', 'replace')
+ if bname == blabel:
+ found_the_action_block = True
+ # If there is an action block in use, change the name
+ if len(similars) > 0 and found_the_action_block:
defaults = [_('action')]
if self._find_proto_name('stack', defaults[0]):
defaults[0] = increment_name(defaults[0])