sepal_ui.scripts.decorator.loading_button#

sepal_ui.scripts.decorator.loading_button(alert=None, button=None, debug=None)[source]#

Decorator to execute try/except sentence and toggle loading button object.

Designed to work within the Tile object, or any object that have a self.btn and self.alert set.

Parameters:
  • button (Btn | None) – Toggled button

  • alert (Alert | None) – the alert to display the error message

  • debug (bool | None) – Whethers or not the exception should stop the execution. default to False

Returns:

The return statement of the decorated method

Return type:

Any

New in version 3.0: moved from utils to a dedicated module

Deprecated since version 3.0: use sepal_ui.scripts.decorator.need_ee instead