Skip to content

Commit

Permalink
Better types
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Sep 27, 2022
1 parent 2f0fc65 commit 4fffb93
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/camera_input_live/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def camera_input_live(
"""
Add a descriptive docstring
"""
b64_data = _component_func(
b64_data: Optional[str] = _component_func(
height=height,
width=width,
debounce=debounce,
Expand All @@ -36,12 +36,14 @@ def camera_input_live(
key=key,
)

if b64_data is not None:
raw_data = b64_data.split(",")[1] # Strip the data: type prefix
if b64_data is None:
return None

component_value = BytesIO(base64.b64decode(raw_data))
raw_data = b64_data.split(",")[1] # Strip the data: type prefix

return component_value
component_value = BytesIO(base64.b64decode(raw_data))

return component_value


def main():
Expand Down

0 comments on commit 4fffb93

Please sign in to comment.