Decorators

Utility decorators.

check_communicating(func)[source]

Return a function that checks component communication before calling a function.

The component manager needs to have established communications with the component before the function is called but if there is no communication the function will be sent to the component and the client will be informed

This function is intended to be used as a decorator:

@check_communicating
def slew(self): ...
Parameters:

func (Any) – the wrapped function

Return type:

Any

Returns:

the wrapped function

log_tango_attr_write()[source]

Log Tango attribute write details with operator tag.

This decorator logs the attribute name and value using the device logger so logs can be filtered downstream via the operator tag.

Return type:

Callable

log_tango_command()[source]

Log Tango command details with operator tag.

This decorator logs the command name and arguments using the device logger so logs can be filtered downstream via the operator tag.

Return type:

Callable

record_command(record_mode=False)[source]
Return a function that records the ‘lastcommandinvoked’ and or ‘lastcommandedmode’

before calling the command.

Parameters:

record_mode (bool) – Flag to update both or only ‘lastcommandinvoked’, ‘lastcommandedmode’.

Return type:

Callable

requires_component_manager(func)[source]

Decorator that checks if component_manager is available.

Return type:

Any