From 068a2d1663645a1d34bac8c317eda8b87fbea9db Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 12 Jul 2023 12:06:29 +0800 Subject: [PATCH] progress_bar: refactor data_changed --- artiq/applets/progress_bar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/applets/progress_bar.py b/artiq/applets/progress_bar.py index f7eed5c9e..b25d380d8 100644 --- a/artiq/applets/progress_bar.py +++ b/artiq/applets/progress_bar.py @@ -12,12 +12,12 @@ class ProgressWidget(QtWidgets.QProgressBar): self.setMaximum(args.max) self.dataset_value = args.value - def data_changed(self, data, mods): + def data_changed(self, value, metadata, persist, mods): try: - value = round(data[self.dataset_value][1]) + val = round(value[self.dataset_value]) except (KeyError, ValueError, TypeError): - value = 0 - self.setValue(value) + val = 0 + self.setValue(val)