diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-05-22 21:48:47 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-05-22 21:48:47 (GMT) |
commit | 87b47c329bf60c336303f228e11ece571dbe91de (patch) | |
tree | 49ae3e0722afb420a8e237384c8f36ecf4fb6f04 /pysamples/load_block.py | |
parent | 51d0563b974f4daa7150410f66d1816c42780212 (diff) |
pep8 and pyflakes cleanup
Diffstat (limited to 'pysamples/load_block.py')
-rw-r--r-- | pysamples/load_block.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pysamples/load_block.py b/pysamples/load_block.py index 6a6612b..26dc0b2 100644 --- a/pysamples/load_block.py +++ b/pysamples/load_block.py @@ -53,12 +53,14 @@ def myblock(tw, blkname): (1) translate the label name into the internal block name; (2) 'dock' the block onto a stack where appropriate; and (3) disassociate the new block from the mouse. """ + for name in block_names: # Translate label name into block/prim name. if blkname in block_names[name]: - if (name in block_primitives and \ - block_primitives[name] == name) or \ - name in content_blocks: + if name in block_primitives and \ + block_primitives[name] == name: + return make_block(tw, name, x, y, defaults) + elif name in content_blocks: return make_block(tw, name, x, y, defaults) for name in special_names: # Translate label name into block/prim name. @@ -69,7 +71,7 @@ def myblock(tw, blkname): # Place the block at the active turtle (x, y) and move the turtle # into position to place the next block in the stack. x, y = tw.active_turtle.get_xy() - if type(blkname) == type([]): + if isinstance(blkname) == list: name = blkname[0] value = blkname[1:] dy = int(find_block(tw, name, x, y, value)) |