Skip to content

Commit 749373f

Browse files
FredLL-AvaigaFred Lefévère-Laoide
andauthored
fix annoying bits (#2439)
* 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 <Fred.Lefevere-Laoide@Taipy.io>
1 parent 4cce531 commit 749373f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

taipy/gui/_event_context_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def __enter__(self):
2323
def __exit__(self, exc_type, exc_value, traceback):
2424
if self.__thread_stack:
2525
self.__thread_stack.pop().start()
26+
if exc_value:
27+
raise exc_value
2628
return self
2729

2830
def _add_thread(self, thread: Thread):

taipy/gui/state.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_gui(self) -> "Gui":
8484
Returns:
8585
Gui: The Gui instance for this state object.
8686
"""
87-
raise NotImplementedError
87+
...
8888

8989
def assign(self, name: str, value: t.Any) -> t.Any:
9090
"""Assign a value to a state variable.
@@ -125,7 +125,7 @@ def broadcast(self, name: str, value: t.Any):
125125
name (str): The variable name to update.
126126
value (Any): The new variable value.
127127
"""
128-
raise NotImplementedError
128+
...
129129

130130
def __enter__(self):
131131
self._gui.__enter__()
@@ -149,6 +149,10 @@ def set_favicon(self, favicon_path: t.Union[str, Path]):
149149
"""
150150
self._gui.set_favicon(favicon_path, self)
151151

152+
@abstractmethod
153+
def __getitem__(self, key: str) -> "State":
154+
...
155+
152156

153157
class _GuiState(State):
154158
__gui_attr = "_gui"

0 commit comments

Comments
 (0)