From dcab81275e43920c8fa14fcda73493eb02bd32b9 Mon Sep 17 00:00:00 2001 From: Brent Yi Date: Thu, 21 Mar 2024 01:51:31 -0700 Subject: [PATCH] nit types etc --- src/viser/_gui_handles.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/viser/_gui_handles.py b/src/viser/_gui_handles.py index de6b3cb21..1f561d35a 100644 --- a/src/viser/_gui_handles.py +++ b/src/viser/_gui_handles.py @@ -52,7 +52,8 @@ class GuiContainerProtocol(Protocol): class SupportsRemoveProtocol(Protocol): - def remove(self) -> None: ... + def remove(self) -> None: + ... @dataclasses.dataclass @@ -265,12 +266,13 @@ class UploadedFile: @dataclasses.dataclass class GuiUploadButtonHandle(_GuiInputHandle[UploadedFile]): - """Handle for a button input in our visualizer. + """Handle for an upload file button in our visualizer. - Lets us detect clicks.""" + The `.value` attribute will be updated with the contents of uploaded files. + """ def on_upload( - self: TGuiHandle, func: Callable[[GuiEvent[UploadedFile]], None] + self: TGuiHandle, func: Callable[[GuiEvent[TGuiHandle]], None] ) -> Callable[[GuiEvent[TGuiHandle]], None]: """Attach a function to call when a button is pressed. Happens in a thread.""" self._impl.update_cb.append(func)