Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index d75e336..be44296 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -1447,8 +1447,11 @@ bullets'))
x, y = self.tw.active_turtle.get_xy()
if type(blkname) == type([]):
name = blkname[0]
- value = blkname[1:]
- dy = int(self._find_block(name, x, y, value))
+ if len(blkname) > 1:
+ value = blkname[1:]
+ dy = int(self._find_block(name, x, y, value))
+ else:
+ dy = int(self._find_block(name, x, y))
else:
name = blkname
if name == 'delete':
@@ -1466,10 +1469,13 @@ bullets'))
def _make_block(self, name, x, y, defaults):
x_pos = x + 20
y_pos = y + 20
- for i, v in enumerate(defaults):
- if type(v) == float and int(v) == v:
- defaults[i] = int(v)
- self.tw._new_block(name, x_pos, y_pos, defaults)
+ if defaults is None:
+ self.tw._new_block(name, x_pos, y_pos, defaults)
+ else:
+ for i, v in enumerate(defaults):
+ if type(v) == float and int(v) == v:
+ defaults[i] = int(v)
+ self.tw._new_block(name, x_pos, y_pos, defaults)
# Find the block we just created and attach it to a stack.
self.tw.drag_group = None