Loading CHANGELOG.md +4 −0 Original line number Diff line number Diff line ### nova-trame, 0.25.1 * ExecutionButtons now supports binding to stop_btn and download_btn parameters (thanks to John Duggan). ### nova-trame, 0.25.0 * FileUpload now supports a return_contents parameter (thanks to John Duggan). Loading pyproject.toml +1 −1 Original line number Diff line number Diff line [project] name = "nova-trame" version = "0.25.0" version = "0.25.1" description = "A Python Package for injecting curated themes and custom components into Trame applications" authors = [ { name = "John Duggan", email = "dugganjw@ornl.gov" }, Loading src/nova/trame/view/components/execution_buttons.py +15 −4 Original line number Diff line number Diff line """Module for the Progress Tab.""" from typing import Tuple, Union from trame.app import get_server from trame.widgets import client from trame.widgets import vuetify3 as vuetify Loading @@ -15,16 +17,17 @@ class ExecutionButtons: This is intended to be used with the `nova-galaxy ToolRunner <https://nova-application-development.readthedocs.io/projects/nova-galaxy/en/latest/core_concepts/tool_runner.html>`__. """ def __init__(self, id: str, stop_btn: bool = False, download_btn: bool = False) -> None: def __init__(self, id: str, stop_btn: Union[bool, Tuple] = False, download_btn: Union[bool, Tuple] = False) -> None: """Constructor for ExecutionButtons. Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components. stop_btn: bool Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. stop_btn: Union[bool, Tuple] Display stop button. download_btn : bool download_btn : Union[bool, Tuple] Display download button. Returns Loading Loading @@ -69,6 +72,9 @@ class ExecutionButtons: click=self.run, ) if self.stop_btn: extra_params = {} if isinstance(self.stop_btn, tuple): extra_params["v_if"] = self.stop_btn vuetify.VBtn( "Stop", disabled=(f"{self.id}.stop_disabled",), Loading @@ -77,6 +83,7 @@ class ExecutionButtons: id=f"{self.id}_stop", prepend_icon="mdi-stop", click=self.stop, **extra_params, ) vuetify.VBtn( "Cancel", Loading @@ -89,12 +96,16 @@ class ExecutionButtons: click=self.cancel, ) if self.download_btn: extra_params = {} if isinstance(self.download_btn, tuple): extra_params["v_if"] = self.download_btn vuetify.VBtn( "Download Results", disabled=(f"{self.id}.download_disabled",), loading=(f"{self.id}.download_in_progress",), id=f"{self.id}.download", click=self.download, **extra_params, ) async def download(self) -> None: Loading src/nova/trame/view/components/progress_bar.py +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ class ProgressBar: Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. Returns ------- Loading src/nova/trame/view/components/tool_outputs.py +2 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ class ToolOutputWindows: Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. Returns ------- Loading Loading
CHANGELOG.md +4 −0 Original line number Diff line number Diff line ### nova-trame, 0.25.1 * ExecutionButtons now supports binding to stop_btn and download_btn parameters (thanks to John Duggan). ### nova-trame, 0.25.0 * FileUpload now supports a return_contents parameter (thanks to John Duggan). Loading
pyproject.toml +1 −1 Original line number Diff line number Diff line [project] name = "nova-trame" version = "0.25.0" version = "0.25.1" description = "A Python Package for injecting curated themes and custom components into Trame applications" authors = [ { name = "John Duggan", email = "dugganjw@ornl.gov" }, Loading
src/nova/trame/view/components/execution_buttons.py +15 −4 Original line number Diff line number Diff line """Module for the Progress Tab.""" from typing import Tuple, Union from trame.app import get_server from trame.widgets import client from trame.widgets import vuetify3 as vuetify Loading @@ -15,16 +17,17 @@ class ExecutionButtons: This is intended to be used with the `nova-galaxy ToolRunner <https://nova-application-development.readthedocs.io/projects/nova-galaxy/en/latest/core_concepts/tool_runner.html>`__. """ def __init__(self, id: str, stop_btn: bool = False, download_btn: bool = False) -> None: def __init__(self, id: str, stop_btn: Union[bool, Tuple] = False, download_btn: Union[bool, Tuple] = False) -> None: """Constructor for ExecutionButtons. Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components. stop_btn: bool Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. stop_btn: Union[bool, Tuple] Display stop button. download_btn : bool download_btn : Union[bool, Tuple] Display download button. Returns Loading Loading @@ -69,6 +72,9 @@ class ExecutionButtons: click=self.run, ) if self.stop_btn: extra_params = {} if isinstance(self.stop_btn, tuple): extra_params["v_if"] = self.stop_btn vuetify.VBtn( "Stop", disabled=(f"{self.id}.stop_disabled",), Loading @@ -77,6 +83,7 @@ class ExecutionButtons: id=f"{self.id}_stop", prepend_icon="mdi-stop", click=self.stop, **extra_params, ) vuetify.VBtn( "Cancel", Loading @@ -89,12 +96,16 @@ class ExecutionButtons: click=self.cancel, ) if self.download_btn: extra_params = {} if isinstance(self.download_btn, tuple): extra_params["v_if"] = self.download_btn vuetify.VBtn( "Download Results", disabled=(f"{self.id}.download_disabled",), loading=(f"{self.id}.download_in_progress",), id=f"{self.id}.download", click=self.download, **extra_params, ) async def download(self) -> None: Loading
src/nova/trame/view/components/progress_bar.py +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ class ProgressBar: Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. Returns ------- Loading
src/nova/trame/view/components/tool_outputs.py +2 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ class ToolOutputWindows: Parameters ---------- id : str Component id. Should be used consistently with ToolRunner and other components Component id. Should be used consistently with ToolRunner and other components. Note that this parameter does not support Trame bindings. Returns ------- Loading