Skip to content

Commit

Permalink
fix annoying bits (#2439)
Browse files Browse the repository at this point in the history
* fix annoying bits
- exception swallowed but event manager
- dict notation for state

* no implementation for abstract methods

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
  • Loading branch information
FredLL-Avaiga and Fred Lefévère-Laoide authored Feb 6, 2025
1 parent 4cce531 commit 749373f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions taipy/gui/_event_context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __enter__(self):
def __exit__(self, exc_type, exc_value, traceback):
if self.__thread_stack:
self.__thread_stack.pop().start()
if exc_value:
raise exc_value
return self

def _add_thread(self, thread: Thread):
Expand Down
8 changes: 6 additions & 2 deletions taipy/gui/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_gui(self) -> "Gui":
Returns:
Gui: The Gui instance for this state object.
"""
raise NotImplementedError
...

def assign(self, name: str, value: t.Any) -> t.Any:
"""Assign a value to a state variable.
Expand Down Expand Up @@ -125,7 +125,7 @@ def broadcast(self, name: str, value: t.Any):
name (str): The variable name to update.
value (Any): The new variable value.
"""
raise NotImplementedError
...

def __enter__(self):
self._gui.__enter__()
Expand All @@ -149,6 +149,10 @@ def set_favicon(self, favicon_path: t.Union[str, Path]):
"""
self._gui.set_favicon(favicon_path, self)

@abstractmethod
def __getitem__(self, key: str) -> "State":
...


class _GuiState(State):
__gui_attr = "_gui"
Expand Down

0 comments on commit 749373f

Please sign in to comment.