pysepal.sepalwidgets.btn.TaskButton#

class pysepal.sepalwidgets.btn.TaskButton(*args, **kwargs)[source]#

Custom toggle button using a to start and cancel a task.

Initialize the TaskButton with Vue component.

Parameters:
  • label (str) – Initial button text

  • cancel_text (str) – Text to show when task is running

  • original_color (str) – Button color when not running

  • cancel_color (str) – Button color when running

  • original_icon (str) – Icon when not running

  • cancel_icon (str) – Icon when running

  • show_loading (bool) – Whether to show loading spinner when running

  • small (bool) – Make button small

  • x_small (bool) – Make button extra small

  • large (bool) – Make button large

  • x_large (bool) – Make button extra large

  • block (bool) – Make button full width (block-level)

  • **kwargs – Additional VuetifyTemplate arguments

Attributes

block

A boolean (True, False) trait.

cancel_color

A trait for unicode strings.

cancel_icon

A trait for unicode strings.

cancel_text

A trait for unicode strings.

disabled

A boolean (True, False) trait.

is_running

A boolean (True, False) trait.

large

A boolean (True, False) trait.

original_color

A trait for unicode strings.

original_icon

A trait for unicode strings.

original_text

A trait for unicode strings.

show_loading

A boolean (True, False) trait.

small

A boolean (True, False) trait.

template_file

A trait for unicode strings.

x_large

A boolean (True, False) trait.

x_small

A boolean (True, False) trait.

Methods

__init__

Initialize the TaskButton with Vue component.

configure

Provide (or update) the factory and args for the task anytime before starting.

vue_on_click_python

Handle button click from Vue component.

TaskButton.__init__(label='Start Task', cancel_text='Cancel', original_color='primary', cancel_color='error', original_icon='', cancel_icon='mdi-close', show_loading=True, small=False, x_small=False, large=False, x_large=False, block=False, **kwargs)[source]#

Initialize the TaskButton with Vue component.

Parameters:
  • label (str) – Initial button text

  • cancel_text (str) – Text to show when task is running

  • original_color (str) – Button color when not running

  • cancel_color (str) – Button color when running

  • original_icon (str) – Icon when not running

  • cancel_icon (str) – Icon when running

  • show_loading (bool) – Whether to show loading spinner when running

  • small (bool) – Make button small

  • x_small (bool) – Make button extra small

  • large (bool) – Make button large

  • x_large (bool) – Make button extra large

  • block (bool) – Make button full width (block-level)

  • **kwargs – Additional VuetifyTemplate arguments

TaskButton.configure(task_factory, start_args=(), start_kwargs=None)[source]#

Provide (or update) the factory and args for the task anytime before starting.

Parameters:
  • task_factory (Callable[[], GEETask[Any]])

  • start_args (tuple)

  • start_kwargs (dict | None)

TaskButton.vue_on_click_python(*args)[source]#

Handle button click from Vue component.