ipygee.decorator#

Decorators used in ipygee.

ported from 12rambau/sepal_ui

Functions#

switch(*params[, member, debug])

Decorator to switch the state of input boolean parameters on class widgets or the class itself.

Module Contents#

ipygee.decorator.switch(*params, member=None, debug=True)[source]#

Decorator to switch the state of input boolean parameters on class widgets or the class itself.

If widget is defined, it will switch the state of every widget parameter, otherwise it will change the state of the class (self). You can also set two decorators on the same function, one could affect the class and other the widget.

Parameters:
  • *params – any boolean member of a Widget.

  • member (Optional[str]) – THe widget on which the member are switched. Default to self.

  • debug (bool) – Whether trigger or not an Exception if the decorated function fails.

Returns:

The return statement of the decorated method

Return type:

Any