tango.pyaml.initializable_element#

Lazy initialization support for Tango-backed elements.

Tango connections are expensive and may fail when the control system is not reachable. Elements derived from InitializableElement postpone any Tango call until the first access, through _ensure_initialized().

Classes

InitializableElement()

Base class for elements whose Tango resources are created lazily.

class tango.pyaml.initializable_element.InitializableElement#

Bases: object

Base class for elements whose Tango resources are created lazily.

Subclasses implement initialize() to open the Tango connections they need and call _ensure_initialized() at the beginning of every method that requires them.

_initialized#

True once initialize() has been called.

Type:

bool

initialize()#

Create the Tango resources needed by the element.

name()#

Return the element name.

is_initialized()#

Tell whether the element has already been initialized.

abstractmethod initialize()#

Create the Tango resources needed by the element.

Subclasses must call super().initialize() so that the initialization flag is set.

is_initialized()#

Tell whether the element has already been initialized.

Returns:

boolTrue if initialize() has been called.

Return type:

bool

abstractmethod name()#

Return the element name.

Returns:

str – Element name.

Return type:

str