From 87b47c329bf60c336303f228e11ece571dbe91de Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 22 May 2013 21:48:47 +0000 Subject: pep8 and pyflakes cleanup --- (limited to 'pysamples/load_block.py') 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)) -- cgit v0.9.1