Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-09-09 10:04:07 (GMT)
committer Marion <marion.zepf@gmail.com>2013-09-09 10:04:07 (GMT)
commit5079cc294deeb334ee2a07d746fd76b7dcda6a74 (patch)
tree5a3b5517a7aa15d1d87f66e02056bebec52dd770 /TurtleArt/tawindow.py
parent510f518669f9c58020d145adc7cde6ff96297731 (diff)
parent89c3fc127cadc61da556165020f7cd82649cf7fd (diff)
Merge branch 'mainline/master' into type-system
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py42
1 files changed, 25 insertions, 17 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 52cf2c4..ea7bf05 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -3972,34 +3972,42 @@ before making changes to your Turtle Blocks program'))
self._process_block_data[b[0]] = [
b[0], b[1], b[2], b[3], [b[4][0], i, b[4][1]]]
elif btype == 'hat':
+ name = None
if b[4][1] < len(self._process_block_data):
i = b[4][1]
- name = self._process_block_data[i][1][1]
+ if i is not None:
+ name = self._process_block_data[i][1][1]
else:
i = b[4][1] - len(self._process_block_data)
name = self._extra_block_data[i][1][1]
- while self._find_proto_name('stack_%s' % (name), name):
- name = increment_name(name)
- if b[4][1] < len(self._process_block_data):
- dblk = self._process_block_data[i]
- self._process_block_data[i] = [dblk[0], (dblk[1][0], name),
- dblk[2], dblk[3], dblk[4]]
- else:
- dblk = self._extra_block_data[i]
- self._extra_block_data[i] = [dblk[0], (dblk[1][0], name),
- dblk[2], dblk[3], dblk[4]]
- self._new_stack_block(name)
+ if name is not None:
+ while self._find_proto_name('stack_%s' % (name), name):
+ name = increment_name(name)
+ if b[4][1] < len(self._process_block_data):
+ dblk = self._process_block_data[i]
+ self._process_block_data[i] = [
+ dblk[0], (dblk[1][0], name), dblk[2], dblk[3],
+ dblk[4]]
+ else:
+ dblk = self._extra_block_data[i]
+ self._extra_block_data[i] = [
+ dblk[0], (dblk[1][0], name), dblk[2], dblk[3],
+ dblk[4]]
+ self._new_stack_block(name)
elif btype == 'storein':
+ name = None
if b[4][1] < len(self._process_block_data):
i = b[4][1]
- name = self._process_block_data[i][1][1]
+ if i is not None:
+ name = self._process_block_data[i][1][1]
else:
i = b[4][1] - len(self._process_block_data)
name = self._extra_block_data[i][1][1]
- if not self._find_proto_name('storein_%s' % (name), name):
- self._new_storein_block(name)
- if not self._find_proto_name('box_%s' % (name), name):
- self._new_box_block(name)
+ if name is not None:
+ if not self._find_proto_name('storein_%s' % (name), name):
+ self._new_storein_block(name)
+ if not self._find_proto_name('box_%s' % (name), name):
+ self._new_box_block(name)
if btype in content_blocks:
if btype == 'number':