Fix mypy issues with the DigitalLibrary plugin

This commit is contained in:
Kostas Karmas 2021-04-22 15:00:42 +02:00
parent 83767764db
commit bc408a5a67
7 changed files with 43 additions and 30 deletions

View file

@ -83,8 +83,10 @@ class DFFileUploader:
"""
if self._finished:
raise ValueError("The upload is already finished")
Logger.log("i", "Uploading DF file to project '{library_project_id}' via link '{upload_url}'".format(library_project_id = self._df_file.library_project_id, upload_url = self._df_file.upload_url))
if isinstance(self._df_file, DFLibraryFileUploadResponse):
Logger.log("i", "Uploading Cura project file '{file_name}' via link '{upload_url}'".format(file_name = self._df_file.file_name, upload_url = self._df_file.upload_url))
elif isinstance(self._df_file, DFPrintJobUploadResponse):
Logger.log("i", "Uploading Cura print file '{file_name}' via link '{upload_url}'".format(file_name = self._df_file.job_name, upload_url = self._df_file.upload_url))
self._http.put(
url = cast(str, self._df_file.upload_url),
headers_dict = {"Content-Type": cast(str, self._df_file.content_type)},