Do not use the JsonDecorator scope for binary downloads

CURA-7150
This commit is contained in:
Nino van Hooff 2020-03-20 17:31:21 +01:00
parent 96ed85f9c0
commit 72a66f1358
3 changed files with 9 additions and 9 deletions

View file

@ -52,7 +52,8 @@ class Toolbox(QObject, Extension):
self._download_request_data = None # type: Optional[HttpRequestData]
self._download_progress = 0 # type: float
self._is_downloading = False # type: bool
self._scope = JsonDecoratorScope(UltimakerCloudScope(application)) # type: JsonDecoratorScope
self._cloud_scope = UltimakerCloudScope(application) # type: UltimakerCloudScope
self._json_scope = JsonDecoratorScope(self._cloud_scope) # type: JsonDecoratorScope
self._request_urls = {} # type: Dict[str, str]
self._to_update = [] # type: List[str] # Package_ids that are waiting to be updated
@ -149,7 +150,7 @@ class Toolbox(QObject, Extension):
url = "{base_url}/packages/{package_id}/ratings".format(base_url = CloudApiModel.api_url, package_id = package_id)
data = "{\"data\": {\"cura_version\": \"%s\", \"rating\": %i}}" % (Version(self._application.getVersion()), rating)
self._application.getHttpRequestManager().put(url, data = data.encode(), scope = self._scope)
self._application.getHttpRequestManager().put(url, data = data.encode(), scope = self._json_scope)
def getLicenseDialogPluginFileLocation(self) -> str:
return self._license_dialog_plugin_file_location
@ -539,7 +540,7 @@ class Toolbox(QObject, Extension):
self._application.getHttpRequestManager().get(url,
callback = callback,
error_callback = error_callback,
scope=self._scope)
scope=self._json_scope)
@pyqtSlot(str)
def startDownload(self, url: str) -> None:
@ -552,7 +553,7 @@ class Toolbox(QObject, Extension):
callback = callback,
error_callback = error_callback,
download_progress_callback = download_progress_callback,
scope=self._scope
scope=self._cloud_scope
)
self._download_request_data = request_data