needle_positions Module

This module provides the interface to the AYAB shield.

class AYABInterface.needle_positions.NeedlePositions(rows, machine)[source]

Bases: object

An interface that just focusses on the needle positions.

__init__(rows, machine)[source]

Create a needle interface.


ValueError – if the arguments are not valid, see check()


list of weak references to the object (if defined)


Check for validity.


The indices of the completed rows.

Return type:list

When a row was completed, the index of the row turns up here. The order is preserved, entries may occur duplicated.

get_row(index, default=None)[source]

Return the row at the given index or the default value.


The machine these positions are on.


Add an observer for completed rows.

Parameters:callable – a callable that is called with the row index as first argument

When row_completed() was called, this callable is called with the row index as first argument. Call this method several times to register more observers.


Mark the row at index as completed.

This method notifies the obsevrers from on_row_completed().