helpers#

class ImportButton(callback)[source]#

Bases: tomopyui.widgets.helpers.ReactiveButtonBase

Import button found throughout the app.

enable()[source]#
run_callback(*args)[source]#
switch_disabled()[source]#
class MetaCheckbox(description, dictionary, obj, disabled=False, value=False)[source]#

Bases: object

class OutputWidgetHandler(*args, **kwargs)[source]#

Bases: logging.Handler

Custom logging handler sending logs to an output widget

clear_logs()[source]#

Clear the current logs

emit(record)[source]#

Overload of logging.Handler method

show_logs()[source]#

Show the logs

class ReactiveButtonBase(callback, description='', description_during='', description_after='', icon='', icon_during='fas fa-cog fa-spin fa-lg', icon_after='fa-check-square', button_style='', button_style_during='info', button_style_after='success', style=None, disabled=False, layout=None, tooltip=None, warning="That button click didn't work.")[source]#

Bases: abc.ABC

Base class for a reactive button.

Parameters
description: str

Button description, initial.

description_during: str

Button description, during reaction.

description_after: str

Button description, during reaction.

icon: str

FontAwesome icon, initial.

icon_during: str

FontAwesome icon, during reaction.

icon_after: str

FontAwesome icon, after reaction.

button_style: str

Changes button color, initial. Can be “info”, “success”, “”, “warning”, or “danger”

button_style_during: str

Changes button color, during callback. Can be “info”, “success”, “”, “warning”, or “danger”

button_style_after: str

Changes button color, after callback. Can be “info”, “success”, “”, “warning”, or “danger”

disable()[source]#
enable()[source]#
reset_state()[source]#
abstract run_callback(*args)[source]#
switch_disabled()[source]#
warning(*args)[source]#
class ReactiveIconButton(callback, icon, tooltip, skip_during=False, *args, **kwargs)[source]#

Bases: tomopyui.widgets.helpers.ReactiveButtonBase

run_callback(*args)[source]#
class ReactiveTextButton(callback, description, description_during, description_after, warning="That button didn't work.", layout=Layout(align_items='stretch', height='auto', width='auto'))[source]#

Bases: tomopyui.widgets.helpers.ReactiveButtonBase

run_callback(*args)[source]#
class SwitchOffOnIconButton(callback_on, callback_off, icon)[source]#

Bases: tomopyui.widgets.helpers.ReactiveButtonBase

Subclass for buttons that turn off and on (green on, grey off).

run_callback(*args)[source]#
class Timer(timeout, callback)[source]#

Bases: object

cancel()[source]#
start()[source]#
create_checkbox(description, disabled=False, value=False)[source]#
create_checkboxes_from_opt_list(opt_list, dictionary, obj)[source]#
debounce(wait)[source]#

Decorator that will postpone a function’s execution until after wait seconds have elapsed since the last time it was invoked.

import_module_set_env(import_dict)[source]#

https://stackoverflow.com/questions/1051254/check-if-python-package-is-installed

Safely imports a module or package and sets an environment variable if it imports (or is already imported). This is used in the main function for checking whether or not cupy is installed. If it is not installed, then options for cuda-enabled functions will be greyed out.

return_handler(logger, logging_level=None)[source]#
set_checkbox_bool(checkbox_list, dictionary, obj)[source]#