Skip to content

Commit

Permalink
fix: don't call application if it's a subclass of PageWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Jan 20, 2024
1 parent 0557b17 commit fa06e4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.7.9

- fix: don't call `application` if it's a subclass of `PageWidget`

## Version 0.7.8

- feat: make all fields of `Menu` and `Item` and their sub classes accept callables
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ubo-gui"
version = "0.7.8"
version = "0.7.9"
description = "GUI sdk for Ubo Pod"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion ubo_gui/menu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ def select(self: MenuWidget, index: int) -> None:
direction='left',
)
elif isinstance(item, ApplicationItem):
application = process_value(item.application)
if not isinstance(item.application, type) or not issubclass(
item.application,
PageWidget,
):
application = process_value(item.application)
else:
application = item.application
application_instance = application(name=uuid.uuid4().hex)
self.open_application(application_instance)
elif isinstance(item, SubMenuItem):
Expand Down

0 comments on commit fa06e4a

Please sign in to comment.