shyft.dashboard.time_series.attr_callback_manager

Classes

AttributeCallbackManager()

This object gives possibility to add on_change callbacks on all class attributes.

class shyft.dashboard.time_series.attr_callback_manager.AttributeCallbackManager[source]

Bases: object

This object gives possibility to add on_change callbacks on all class attributes. Whenever the attributes is changed, the registered callbacks are called.

The callbcak signature is as follows:

callback(obj: Any, attr: str, value: Any)

where:
  • obj: is the class instance which attribute was changed

  • attr: name of the attribute

  • value: the new value of the attribute

__init__() None[source]
on_change(*, obj: Any, attr: str, callback: Callable[[str, Any], None]) None[source]

Add a callback on this object to trigger when attr changes.

remove_all_callbacks(obj: Any) None[source]

This function removes all callbacks for which are registred for obj