diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-10-13 11:13:06 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-10-13 11:13:06 +0300 |
commit | 24cd2046f8e936fc1d30bea46df8a59e2859a125 (patch) | |
tree | ba84d80984226903e01cd7b2f6bacde056ac22bd /cura/PrinterOutput | |
parent | af54316690eecba8ee09aabeaabd9dff9fed1694 (diff) |
Initialise _printer_metadata as a list instead of a dict
It should become a list later on, in any case.
Contributes to issue CURA-8609.
Diffstat (limited to 'cura/PrinterOutput')
-rw-r--r-- | cura/PrinterOutput/UploadMaterialsJob.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cura/PrinterOutput/UploadMaterialsJob.py b/cura/PrinterOutput/UploadMaterialsJob.py index b082b47cbb..ff273c06c0 100644 --- a/cura/PrinterOutput/UploadMaterialsJob.py +++ b/cura/PrinterOutput/UploadMaterialsJob.py @@ -18,7 +18,7 @@ from UM.Signal import Signal from UM.TaskManagement.HttpRequestManager import HttpRequestManager # To call the API. from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope -from typing import Any, Dict, Optional, TYPE_CHECKING +from typing import Any, cast, Dict, List, Optional, TYPE_CHECKING if TYPE_CHECKING: from PyQt5.QtNetwork import QNetworkReply from cura.UltimakerCloud.CloudMaterialSync import CloudMaterialSync @@ -52,7 +52,7 @@ class UploadMaterialsJob(Job): self._archive_filename = None # type: Optional[str] self._archive_remote_id = None # type: Optional[str] # ID that the server gives to this archive. Used to communicate about the archive to the server. self._printer_sync_status = {} # type: Dict[str, str] - self._printer_metadata = {} # type: Dict[str, Any] + self._printer_metadata = [] # type: List[Dict[str, Any]] self.processProgressChanged.connect(self._onProcessProgressChanged) uploadCompleted = Signal() @@ -113,7 +113,7 @@ class UploadMaterialsJob(Job): upload_url = response_data["upload_url"] self._archive_remote_id = response_data["material_profile_id"] - with open(self._archive_filename, "rb") as f: + with open(cast(str, self._archive_filename), "rb") as f: file_data = f.read() http = HttpRequestManager.getInstance() http.put( |