Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/TurtleArt/tablock.py
diff options
Diffstat (limited to 'TurtleArt/tablock.py')
1 files changed, 25 insertions, 1 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py
index 2658624..8d8ed4a 100644
--- a/TurtleArt/tablock.py
+++ b/TurtleArt/tablock.py
@@ -125,7 +125,31 @@ 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 of the form
+ [type_of_dock, flow_is_in, x, y, parenthesis]
+ with the last element being optional.
+ type_of_dock may be one of the following strings:
+ 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')
+ flow_is_in is True if the flow is into the block, or False for out.
+ x and y are coodinates for positioning the block on the dock.
+ parenthesis is only used with arguments and ensures a known order
+ of arguments for arithmetic and logical operations.
+ 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],