From 790829493ce32ee9e0a95d994fff3560f4074a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Tue, 15 Oct 2024 21:05:21 -0500 Subject: [PATCH] try fixing tests --- napari_plugin_manager/qt_plugin_dialog.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/napari_plugin_manager/qt_plugin_dialog.py b/napari_plugin_manager/qt_plugin_dialog.py index bf3a2e8..5853491 100644 --- a/napari_plugin_manager/qt_plugin_dialog.py +++ b/napari_plugin_manager/qt_plugin_dialog.py @@ -948,9 +948,7 @@ def _setup_shortcuts(self): self._quit_action.triggered.connect(self._quit) self.addAction(self._quit_action) - self._close_shortcut = QShortcut( - QKeySequence('Ctrl+W'), self - ) + self._close_shortcut = QShortcut(QKeySequence('Ctrl+W'), self) self._close_shortcut.activated.connect(self.close) get_settings().appearance.events.theme.connect(self._update_theme) @@ -996,13 +994,17 @@ def _on_process_finished(self, process_finished_data: ProcessFinishedData): for pkg_name in pkg_names: self.installed_list.refreshItem(pkg_name) elif action == InstallerActions.UPGRADE: - print('process_finished_data', process_finished_data) - pkg_info = [ - (pkg.split('==')[0], pkg.split('==')[1]) - for pkg in process_finished_data['pkgs'] - ] - for pkg_name, pkg_version in pkg_info: - self.installed_list.refreshItem(pkg_name, version=pkg_version) + for pkg in process_finished_data['pkgs']: + if '==' in pkg: + pkg_name, pkg_version = ( + pkg.split('==')[0], + pkg.split('==')[1], + ) + self.installed_list.refreshItem( + pkg_name, version=pkg_version + ) + else: + self.installed_list.refreshItem(pkg) self._tag_outdated_plugins() elif action in [InstallerActions.CANCEL, InstallerActions.CANCEL_ALL]: for pkg_name in pkg_names: @@ -1468,6 +1470,7 @@ def _refresh_and_clear_cache(self): # region - Qt overrides # ------------------------------------------------------------------------ def closeEvent(self, event): + print('CLOSE EVENT CALLED') if self._parent is not None: plugin_dialog = getattr(self._parent, '_plugin_dialog', self) if self != plugin_dialog: