stormvogel.dict_editor

Generate an interactive editor from a specified schema using ipywidgets. This is used to create the layout editing menu. Example usage can be found in property_builder.py.

Classes

WidgetWrapper

Create a widget specified in the arguments.

DictEditor

Create an interactive JSON editor from a schema using ipywidgets.

Module Contents

class stormvogel.dict_editor.WidgetWrapper(description: str, widget: str, path: list[str], initial_value: Any, update_dict: dict, on_update: Callable[[], None], **kwargs)

Create a widget specified in the arguments.

convert_dict
update_dict: dict
path: list[str]
on_update: Callable
on_edit(x: Any) None

Update self.update_dict[self.path] and call the on_update function.

Parameters:

x – The new value set by the user.

class stormvogel.dict_editor.DictEditor(schema: dict, update_dict: dict, on_update: Callable[[], None], output: ipywidgets.Output | None = None, do_display: bool = True, debug_output: ipywidgets.Output = widgets.Output())

Bases: stormvogel.displayable.Displayable

Create an interactive JSON editor from a schema using ipywidgets.

on_update: Callable
update_dict: dict
macros: dict
schema: dict
show()
recurse_create(sub_schema: dict, path: list) ipywidgets.Widget