Reading packages from archive now uses With context

This commit is contained in:
Jaime van Kessel 2018-05-03 20:22:38 +02:00
parent defb22dc07
commit 7665f8a7cb
2 changed files with 31 additions and 35 deletions

View file

@ -420,10 +420,9 @@ class Toolbox(QObject, Extension):
def _onDownloadComplete(self, file_path: str):
Logger.log("i", "Toolbox: Download complete.")
try:
package_info = self._package_manager.getPackageInfo(file_path)
except:
Logger.logException("w", "Toolbox: Package file [%s] was not a valid CuraPackage.", file_path)
package_info = self._package_manager.getPackageInfo(file_path)
if not package_info:
Logger.log("w", "Toolbox: Package file [%s] was not a valid CuraPackage.", file_path)
return
license_content = self._package_manager.getPackageLicense(file_path)
@ -434,8 +433,6 @@ class Toolbox(QObject, Extension):
self.install(file_path)
return
# Getter & Setters for Properties:
# --------------------------------------------------------------------------
def setDownloadProgress(self, progress: int):