Skip to content

Commit

Permalink
nit types etc
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Mar 21, 2024
1 parent 2c0fd9e commit dcab812
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/viser/_gui_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class GuiContainerProtocol(Protocol):


class SupportsRemoveProtocol(Protocol):
def remove(self) -> None: ...
def remove(self) -> None:
...


@dataclasses.dataclass
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit dcab812

Please sign in to comment.