From 6598340c7df1d3c03832c32cc55f31be35dd56ad Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Thu, 26 Sep 2024 17:03:37 -0700 Subject: [PATCH] Change the way listens are handled --- python/pyrogue/_Root.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/pyrogue/_Root.py b/python/pyrogue/_Root.py index 06d1b3374..45a1aa8b7 100644 --- a/python/pyrogue/_Root.py +++ b/python/pyrogue/_Root.py @@ -1008,6 +1008,13 @@ def _queueUpdates(self,var): self._updateTrack[tid] = UpdateTracker(self._updateQueue) self._updateTrack[tid].update(var) + # Recursively add listeners to update list + def _recurseAddListeners(self, nvars, var): + for vl in var._listeners: + nvars[vl.path] = vl + + self._recurseAddListeners(nvars, vl) + # Worker thread def _updateWorker(self): """ """ @@ -1029,8 +1036,7 @@ def _updateWorker(self): # Copy list and add listeners nvars = uvars.copy() for p,v in uvars.items(): - for vl in v._listeners: - nvars[vl.path] = vl + self._recurseAddListeners(nvars, v) # Process the new list for p,v in nvars.items():