ExecutionBaseCommand¶
- class pyniryo_nate.components.ExecutionBaseCommand(programs: Programs, program_id: str, execution_id: str, timeout: float, on_output: Callable[[str, bool], None] | None, on_status: Callable[[ExecutorStatus], None] | None)[source]¶
Bases:
BaseCommandRepresents a program execution command. Monitors the output and status during the execution.
Attributes
command_idGet the command ID of the command.
Fetch the execution from the robot, with its context, timestamps and exit code.
Get the current status of the execution.
Methods
Wait for the program execution to complete.
- Parameters:
programs (Programs)
program_id (str)
execution_id (str)
timeout (float)
on_output (Callable[[str, bool], None] | None)
on_status (Callable[[ExecutorStatus], None] | None)
- property status: ExecutorStatus¶
Get the current status of the execution.
- Returns:
The current status of the execution.
- property execution: ProgramExecution¶
Fetch the execution from the robot, with its context, timestamps and exit code.
- Returns:
The execution as the robot reports it now.
- property program_id: str¶
- property execution_id: str¶
- wait() None[source]¶
Wait for the program execution to complete. A paused execution keeps waiting until it is resumed, and the time spent paused counts against the timeout.
- Raises:
TimeoutError – If the timeout is exceeded.
ExecutionStoppedError – If the execution was stopped by a client or by the safety chain.
PyNiryoError – If the execution fails.
- Return type:
None