shyft.dashboard.time_series.attr_callback_manager

Functions

_check_callback(callback, fargs)

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__()[source]
Return type:

None

on_change(*, obj, attr, callback)[source]

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

Parameters:
  • obj (Any)

  • attr (str)

  • callback (Callable[[str, Any], None])

Return type:

None

remove_all_callbacks(obj)[source]

This function removes all callbacks for which are registred for obj

Parameters:

obj (Any)

Return type:

None