ophyd.status.Status

class ophyd.status.Status(obj=None, timeout=None, settle_time=0, done=None, success=None)

Track the status of a potentially-lengthy action like moving or triggering.

This has room for an option obj parameter, noting the object associated with action. Status does not use this internally, but it can be useful for external code to keep track of things.

Parameters
timeout: float, optional

The amount of time to wait before marking the Status as failed. If None (default) wait forever. It is strongly encouraged to set a finite timeout. If settle_time below is set, that time is added to the effective timeout.

settle_time: float, optional

The amount of time to wait between the caller specifying that the status has completed to running callbacks. Default is 0.

Attributes
objany or None

The object

__init__(obj=None, timeout=None, settle_time=0, done=None, success=None)

Methods

__init__([obj, timeout, settle_time, done, ...])

add_callback(callback)

Register a callback to be called once when the Status finishes.

exception([timeout])

Return the exception raised by the action.

set_exception(exc)

Mark as finished but failed with the given Exception.

set_finished()

Mark as finished successfully.

wait([timeout])

Block until the action completes.

Attributes

callbacks

Callbacks to be run when the status is marked as finished

done

Boolean indicating whether associated operation has completed.

finished_cb

settle_time

A delay between when set_finished() is when the Status is done.

success

Boolean indicating whether associated operation has completed.

timeout

The timeout for this action.