Row Module

This module contains the rows of instructions of knitting patterns.

The rows are part of knitting patterns. They contain instructions and can be connected to other rows.

class knittingpattern.Row.Row(row_id, values, parser)[source]

Bases: knittingpattern.Prototype.Prototype

This class contains the functionality for rows.

This class is used by knitting patterns.

__init__(row_id, values, parser)[source]

Create a new row.

Parameters:

Note

Seldomly, you need to create this row on your own. You can load it with the knittingpattern or the knittingpattern.Parser.Parser.

__repr__()[source]

The string representation of this row.

Returns:a string representation of this row
Return type:str
color

The color of the row.

Returns:the color of the row as specified or None
consumed_meshes

Same as produced_meshes but for consumed meshes.

first_consumed_mesh

The first consumed mesh.

Returns:the first consumed mesh
Return type:knittingpattern.Mesh.Mesh
Raises:IndexError – if no mesh is consumed
first_instruction

The first instruction of the rows instructions.

Return type:knittingpattern.Instruction.InstructionInRow
Returns:the first instruction in this row’s instructions
first_produced_mesh

The first produced mesh.

Returns:the first produced mesh
Return type:knittingpattern.Mesh.Mesh
Raises:IndexError – if no mesh is produced
id

The id of the row.

Returns:the id of the row
instruction_colors

The colors of the instructions in the row in the order tehy appear.

Returns:a list of colors of the knitting pattern in the order that they appear in
Return type:list
instructions

The instructions in this row.

Returns:a collection of instructions inside the row
Return type:ObservableList.ObservableList
last_consumed_mesh

The last consumed mesh.

Returns:the last consumed mesh
Return type:knittingpattern.Mesh.Mesh
Raises:IndexError – if no mesh is consumed
last_instruction

The last instruction of the rows instructions.

Return type:knittingpattern.Instruction.InstructionInRow
Returns:the last instruction in this row’s instructions
last_produced_mesh

The last produced mesh.

Returns:the last produced mesh
Return type:knittingpattern.Mesh.Mesh
Raises:IndexError – if no mesh is produced
number_of_consumed_meshes

The number of meshes that this row consumes.

Returns:the number of meshes that this row consumes
Return type:int
number_of_produced_meshes

The number of meshes that this row produces.

Returns:the number of meshes that this row produces
Return type:int
produced_meshes

The meshes that this row produces with its instructions.

Returns:a collection of meshes that this instruction produces
rows_after

The rows that consume meshes from this row.

Return type:list
Returns:a list of rows that consume meshes from this row. Each row occurs only once. They are sorted by the first occurrence in the instructions.
rows_before

The rows that produce meshes for this row.

Return type:list
Returns:a list of rows that produce meshes for this row. Each row occurs only once. They are sorted by the first occurrence in the instructions.
knittingpattern.Row.COLOR = 'color'

the color of the row