Merge branch 'master' into WIP_improve_initialization

This commit is contained in:
Lipu Fei 2018-05-28 13:37:26 +02:00 committed by GitHub
commit f395f1eebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 26 deletions

View file

@ -89,7 +89,6 @@ class CuraPackageManager(QObject):
"installed": self._installed_package_dict,
"to_remove": list(self._to_remove_package_set),
"to_install": self._to_install_package_dict}
data_dict["to_remove"] = list(data_dict["to_remove"])
json.dump(data_dict, f, sort_keys = True, indent = 4)
Logger.log("i", "Package management file %s was saved", self._user_package_management_file_path)
@ -103,7 +102,6 @@ class CuraPackageManager(QObject):
# (for initialize) Installs all packages that have been scheduled to be installed.
def _installAllScheduledPackages(self) -> None:
while self._to_install_package_dict:
package_id, package_info = list(self._to_install_package_dict.items())[0]
self._installPackage(package_info)
@ -111,6 +109,12 @@ class CuraPackageManager(QObject):
del self._to_install_package_dict[package_id]
self._saveManagementData()
def getBundledPackageInfo(self, package_id: str) -> Optional[dict]:
package_info = None
if package_id in self._bundled_package_dict:
package_info = self._bundled_package_dict[package_id]["package_info"]
return package_info
# Checks the given package is installed. If so, return a dictionary that contains the package's information.
def getInstalledPackageInfo(self, package_id: str) -> Optional[dict]:
if package_id in self._to_remove_package_set: