From 1bb7cfcd6278eb76dbd6cfb5c39bb129ef92c7f1 Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 18 Jul 2013 11:14:20 +0000 Subject: document attributes of Block class --- diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py index 2658624..c2f9e6a 100644 --- a/TurtleArt/tablock.py +++ b/TurtleArt/tablock.py @@ -125,7 +125,26 @@ class Blocks: class Block: - """ A class for the individual blocks """ + """ A class for the individual blocks + + Attributes: + docks -- a list of docks, i.e. connection points where other blocks + could be attached. Each dock is a list whose first element is a + string representing the type of dock: + flow -- connect to the previous or next block ('slot' or 'tab') + bool, media, number, string -- argument slot ('innie') or return + value ('outie') of the given kind + unavailable -- nothing can be attached here ('cap' or 'tail') + # TODO what do the other list elements mean? + connections -- a list of blocks that are attached to this one (or that + this one is attached to). This list corresponds to the docks list + as it uses the same indices. Slots where nothing is attached are + None on this list. + primitive -- a callable that is called when the block is executed + type -- type of the block: + block -- block that is part of the user's program + proto -- block on a palette, used to generate other blocks + trash -- block in the trash """ def __init__(self, block_list, sprite_list, name, x, y, type='block', values=[], scale=BLOCK_SCALE[0], -- cgit v0.9.1