knitout_interpreter.knitout_operations.Knitout_Line module
Base class for Knitout Lines of code
- class knitout_interpreter.knitout_operations.Knitout_Line.Knitout_Line(comment, interrupts_carriage_pass=False)[source]
Bases:
object
General class for lines of knitout.
- property interrupts_carriage_pass: bool
Check if this line interrupts a carriage pass.
- Returns:
True if this type of line interrupts a carriage pass, False if it is only used for comments or setting information.
- add_follow_comment(comment_line)[source]
Add a comment line to comments that follow this line.
- Parameters:
comment_line (str) – The comment text to add.
- property comment_str: str
Get the comment as a formatted string.
- Returns:
The comment formatted as a string with appropriate formatting.
- execute(machine_state)[source]
Execute the instruction on the machine state.
- Parameters:
machine_state (Knitting_Machine) – The knitting machine state to update.
- Returns:
True if the process completes an update.
- Return type:
- class knitout_interpreter.knitout_operations.Knitout_Line.Knitout_Version_Line(version=2, comment=None)[source]
Bases:
Knitout_Line
Represents a knitout version specification line.
- class knitout_interpreter.knitout_operations.Knitout_Line.Knitout_Comment_Line(comment)[source]
Bases:
Knitout_Line
Represents a comment line in knitout.