diff options
author | Jaime van Kessel <nallath@gmail.com> | 2021-12-17 01:21:44 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2021-12-17 01:21:44 +0300 |
commit | 477f62916c8aec86d71ac309621d72c8a32d0889 (patch) | |
tree | 225756aa47528ad23da79164363ad79b084677a6 | |
parent | fa7ad7ddb19e44363548eeba02b04b9611f83bb9 (diff) |
Further simplify the data being sent over to the package manager
CURA-8587
-rw-r--r-- | cura/CuraPackageManager.py | 3 | ||||
-rw-r--r-- | plugins/Marketplace/LocalPackageList.py | 6 | ||||
-rw-r--r-- | plugins/Toolbox/src/Toolbox.py | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/cura/CuraPackageManager.py b/cura/CuraPackageManager.py index 535d331a62..79763351b9 100644 --- a/cura/CuraPackageManager.py +++ b/cura/CuraPackageManager.py @@ -85,7 +85,4 @@ class CuraPackageManager(PackageManager): return item == self["package_id"] packages = [PkgInfo(package_info) for package in self.getAllInstalledPackagesInfo().values() for package_info in package] - packages.extend([PkgInfo(package["package_info"]) for package in self.getPackagesToRemove().values() if package["package_info"]["package_id"] not in packages]) - packages.extend([PkgInfo(package["package_info"]) for package in self.getPackagesToInstall().values() if package["package_info"]["package_id"] not in packages]) - return [dict(package) for package in packages] diff --git a/plugins/Marketplace/LocalPackageList.py b/plugins/Marketplace/LocalPackageList.py index 3d4ee8cc1b..b531c4040f 100644 --- a/plugins/Marketplace/LocalPackageList.py +++ b/plugins/Marketplace/LocalPackageList.py @@ -49,7 +49,7 @@ class LocalPackageList(PackageList): def _removePackageModel(self, package_id): package = self.getPackageModel(package_id) - if not package.canUpdate and package_id in self._package_manager.getPackagesToRemove() and package_id not in self._package_manager.getPackagesToInstall(): + if not package.canUpdate and package_id in self._package_manager.getToRemovePackageIDs() and package_id not in self._package_manager.getPackagesToInstall(): index = self.find("package", package_id) if index < 0: Logger.error(f"Could not find card in Listview corresponding with {package_id}") @@ -110,5 +110,7 @@ class LocalPackageList(PackageList): return packages = response_data["data"] - self._package_manager.setPackagesWithUpdate(dict(zip([p['package_id'] for p in packages], [p for p in packages]))) + + self._package_manager.setPackagesWithUpdate({p['package_id'] for p in packages}) + self._ongoing_requests["check_updates"] = None diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 5644bace7a..20eec3352b 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -635,7 +635,7 @@ class Toolbox(QObject, Extension): elif request_type == "updates": # Tell the package manager that there's a new set of updates available. packages = self._server_response_data[request_type] - self._package_manager.setPackagesWithUpdate(dict(zip([p['package_id'] for p in packages], [p for p in packages]))) + self._package_manager.setPackagesWithUpdate({p['package_id'] for p in packages}) self.metadataChanged.emit() |