From 715dc79b3670d602be8cb9dfc1a01ca3aa16736e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 15:31:35 +0000 Subject: [PATCH] Keep 5.0.x compatible with pymodaq 5.2: restore the version floors and the quit_fun hook The floors raised to 5.3 by the template alignment are back to pymodaq>5.2.8 and pymodaq_gui>5.0.11. pymodaq < 5.3 only calls quit_fun, so it is defined (calling _quit_fun) when CustomExt has no _quit_fun. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CAhZwmbyCSpSgfTyicUxuS --- pyproject.toml | 6 ++---- .../extensions/spatial_beam_shaping.py | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61e8efc..5c70056 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,13 +12,11 @@ package-url = 'https://github.com/IumiShaping/pymodaq_plugins_optical_2D_shaping name = "pymodaq_plugins_beam_shaping" description = "PyMoDAQ's extension plugin to run optical shaping from various shapers (focusing on amplitude and phase shaping) and the image propagation" dependencies = [ - "pymodaq>=5.3.2", - "pymodaq_utils>=5.3.1", - "pymodaq_gui>=5.3.0", - "pymodaq_data>=5.3.0", + "pymodaq>5.2.8", 'pyfftw', 'scikit-image', 'opencv-python', + 'pymodaq_gui>5.0.11', 'zernpy', ] diff --git a/src/pymodaq_plugins_beam_shaping/extensions/spatial_beam_shaping.py b/src/pymodaq_plugins_beam_shaping/extensions/spatial_beam_shaping.py index 5010b60..a92efd8 100644 --- a/src/pymodaq_plugins_beam_shaping/extensions/spatial_beam_shaping.py +++ b/src/pymodaq_plugins_beam_shaping/extensions/spatial_beam_shaping.py @@ -662,6 +662,11 @@ def _quit_fun(self) -> bool: QtWidgets.QApplication.processEvents() # allows the dashboard modules to close properly return True + if not hasattr(CustomExt, '_quit_fun'): # pymodaq < 5.3 only calls quit_fun, pymodaq >= 5.3 calls _quit_fun + def quit_fun(self): + self._quit_fun() + super().quit_fun() + def main(): import sys