diff --git a/examples/validation/core/17_dev_reload.py b/examples/validation/core/17_dev_reload.py index bb8de3c1..bb940893 100644 --- a/examples/validation/core/17_dev_reload.py +++ b/examples/validation/core/17_dev_reload.py @@ -2,6 +2,7 @@ from trame.app import get_server, dev from trame.widgets import vtk, vuetify from trame.ui.vuetify import SinglePageLayout +from trame_server import Server # ----------------------------------------------------------------------------- # Trame setup @@ -16,14 +17,14 @@ def reset_resolution(): # Mode A ---------------------------------------------------------------------- -def full_reload(): +def full_reload(server: Server): print("=> Reload mode A") dev.remove_change_listeners(server, "resolution") dev.reload(sys.modules.get("__main__")) # Mode B ---------------------------------------------------------------------- -def reload_app(): +def reload_app(server: Server): print("=> Reload mode B") # dev.clear_triggers(app) # Not needed here dev.clear_change_listeners(server) diff --git a/trame/app/dev.py b/trame/app/dev.py index c1893049..ee391a2d 100644 --- a/trame/app/dev.py +++ b/trame/app/dev.py @@ -19,7 +19,7 @@ def clear_change_listeners(server): :param server: server on which we want to clear the state.change listeners :type server: trame_server.core.Server """ - server._change_callbacks.clear() + server.state._change_callbacks.clear() def remove_change_listeners(server, *names): @@ -34,8 +34,8 @@ def remove_change_listeners(server, *names): :type *names: str """ for name in names: - if name in server._change_callbacks: - server._change_callbacks.pop(name) + if name in server.state._change_callbacks: + server.state._change_callbacks.pop(name) def reload(*reload_list):