CURA-5357 Move the plugin info in packages.json only when the

installation succeeded.
This commit is contained in:
Diego Prado Gesto 2018-06-05 11:00:05 +02:00
parent 39b71add07
commit 1285e1b5e5

View file

@ -105,7 +105,6 @@ class CuraPackageManager(QObject):
while self._to_install_package_dict:
package_id, package_info = list(self._to_install_package_dict.items())[0]
self._installPackage(package_info)
self._installed_package_dict[package_id] = self._to_install_package_dict[package_id]
del self._to_install_package_dict[package_id]
self._saveManagementData()
@ -328,6 +327,8 @@ class CuraPackageManager(QObject):
# Remove the file
os.remove(filename)
# Move the info to the installed list of packages only when it succeeds
self._installed_package_dict[package_id] = self._to_install_package_dict[package_id]
def __installPackageFiles(self, package_id: str, src_dir: str, dst_dir: str) -> None:
Logger.log("i", "Moving package {package_id} from {src_dir} to {dst_dir}".format(package_id=package_id, src_dir=src_dir, dst_dir=dst_dir))