diff --git a/plugins/DigitalLibrary/src/DFFileUploader.py b/plugins/DigitalLibrary/src/DFFileUploader.py index 6cad7828e2..23a4620bcf 100644 --- a/plugins/DigitalLibrary/src/DFFileUploader.py +++ b/plugins/DigitalLibrary/src/DFFileUploader.py @@ -39,8 +39,8 @@ class DFFileUploader: :param on_error: The method to be called when an error occurs. """ - self._http = http # type: HttpRequestManager - self._df_file = df_file # type: Union[DFLibraryFileUploadResponse, DFPrintJobUploadResponse] + self._http: HttpRequestManager = http + self._df_file: Union[DFLibraryFileUploadResponse, DFPrintJobUploadResponse] = df_file self._file_name = "" if isinstance(self._df_file, DFLibraryFileUploadResponse): self._file_name = self._df_file.file_name @@ -51,7 +51,7 @@ class DFFileUploader: self._file_name = "" else: raise TypeError("Incorrect input type") - self._data = data # type: bytes + self._data: bytes = data self._on_finished = on_finished self._on_success = on_success diff --git a/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py b/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py index 3456638ba6..de09ea2a09 100644 --- a/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py +++ b/plugins/DigitalLibrary/src/DigitalFactoryApiClient.py @@ -40,7 +40,7 @@ class DigitalFactoryApiClient: DEFAULT_REQUEST_TIMEOUT = 10 # seconds # In order to avoid garbage collection we keep the callbacks in this list. - _anti_gc_callbacks = [] # type: List[Callable[[Any], None]] + _anti_gc_callbacks: List[Callable[[Any], None]] = [] def __init__(self, application: CuraApplication, on_error: Callable[[List[CloudError]], None], projects_limit_per_page: Optional[int] = None) -> None: """Initializes a new digital factory API client. @@ -54,7 +54,7 @@ class DigitalFactoryApiClient: self._scope = JsonDecoratorScope(UltimakerCloudScope(application)) self._http = HttpRequestManager.getInstance() self._on_error = on_error - self._file_uploader = None # type: Optional[DFFileUploader] + self._file_uploader: Optional[DFFileUploader] = None self._library_max_private_projects: Optional[int] = None self._projects_pagination_mgr = PaginationManager(limit = projects_limit_per_page) if projects_limit_per_page else None # type: Optional[PaginationManager]