Merge branch 'main' into CURA-9365

# Conflicts:
#	.github/workflows/ci.yml
#	.github/workflows/cura-installer.yml
#	.github/workflows/requirements-conan-package.txt
#	resources/definitions/Mark2_for_Ultimaker2.def.json
#	resources/definitions/elegoo_neptune_2.def.json
#	resources/definitions/elegoo_neptune_2D.def.json
This commit is contained in:
jspijker 2022-07-08 12:37:32 +02:00
commit f9d4628b95
9 changed files with 75 additions and 57 deletions

View file

@ -1,5 +1,6 @@
# Copyright (c) 2021 Ultimaker B.V.
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
import threading
from json import JSONDecodeError
@ -135,6 +136,9 @@ class DFFileExportAndUploadManager:
else:
Logger.log("e", "Wrong response type received. Aborting uploading file to the Digital Library")
return
if file_name not in self._file_upload_job_metadata:
Logger.error(f"API response for uploading doesn't match the file name we just uploaded: {file_name} was never uploaded.")
return
with self._message_lock:
self.progress_message.show()
self._file_upload_job_metadata[file_name]["file_upload_response"] = file_upload_response
@ -335,10 +339,11 @@ class DFFileExportAndUploadManager:
self._handleNextUploadJob()
def _handleNextUploadJob(self):
match self._upload_jobs:
case [job, *jobs]:
job.start()
self._upload_jobs = jobs
try:
job = self._upload_jobs.pop(0)
job.start()
except IndexError:
pass # Empty list, do nothing.
def initializeFileUploadJobMetadata(self) -> Dict[str, Any]:
metadata = {}