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: - row_id¶ – an identifier for the row
- values¶ – the values from the specification
- inheriting_from¶ (list) – a list of specifications to inherit values
from, see
knittingpattern.Prototype.Prototype
Note
Seldomly, you need to create this row on your own. You can load it with the
knittingpattern
or theknittingpattern.Parser.Parser
.
-
__repr__
()[source]¶ The string representation of this row.
Returns: a string representation of this row Return type: str
-
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 See also
-
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 See also
-
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 See also
-
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 See also
-
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
-
-
knittingpattern.Row.
COLOR
= 'color'¶ the color of the row