diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2020-03-20 19:34:12 +0300 |
---|---|---|
committer | Nino van Hooff <ninovanhooff@gmail.com> | 2020-03-20 19:34:12 +0300 |
commit | 96d1e6385d1e6bb9f95276d6af881c3e37572f1a (patch) | |
tree | 9805c3c207272fc60f008f83a9c24f8958e5cda2 /plugins/CuraDrive | |
parent | 6db8a9ec3e3734b553e60dfe382b78680a625753 (diff) | |
parent | 4e8da5d7fd9585a5b7cd346206abd4a6749724cd (diff) |
Merge remote-tracking branch 'origin/CURA-7150_proper_http_request_headers' into CURA-7150_proper_http_request_headers
Diffstat (limited to 'plugins/CuraDrive')
-rw-r--r-- | plugins/CuraDrive/src/DriveApiService.py | 14 | ||||
-rw-r--r-- | plugins/CuraDrive/src/DrivePluginExtension.py | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/CuraDrive/src/DriveApiService.py b/plugins/CuraDrive/src/DriveApiService.py index 0c8d38ebd2..2248b64389 100644 --- a/plugins/CuraDrive/src/DriveApiService.py +++ b/plugins/CuraDrive/src/DriveApiService.py @@ -86,20 +86,20 @@ class DriveApiService: restore_backup_job.finished.connect(self._onRestoreFinished) restore_backup_job.start() - def _onRestoreFinished(self, job: "RestoreBackupJob"): + def _onRestoreFinished(self, job: "RestoreBackupJob") -> None: if job.restore_backup_error_message != "": # If the job contains an error message we pass it along so the UI can display it. self.restoringStateChanged.emit(is_restoring=False) else: self.restoringStateChanged.emit(is_restoring = False, error_message = job.restore_backup_error_message) - def deleteBackup(self, backup_id: str, finishedCallable: Callable[[bool], None]): + def deleteBackup(self, backup_id: str, finished_callable: Callable[[bool], None]): - def finishedCallback(reply: QNetworkReply, ca=finishedCallable) -> None: - self._onDeleteRequestCompleted(reply, None, ca) + def finishedCallback(reply: QNetworkReply, ca: Callable[[bool], None] = finished_callable) -> None: + self._onDeleteRequestCompleted(reply, ca) - def errorCallback(reply: QNetworkReply, error: QNetworkReply.NetworkError, ca=finishedCallable) -> None: - self._onDeleteRequestCompleted(reply, error, ca) + def errorCallback(reply: QNetworkReply, error: QNetworkReply.NetworkError, ca: Callable[[bool], None] = finished_callable) -> None: + self._onDeleteRequestCompleted(reply, ca, error) HttpRequestManager.getInstance().delete( url = "{}/{}".format(self.BACKUP_URL, backup_id), @@ -109,5 +109,5 @@ class DriveApiService: ) @staticmethod - def _onDeleteRequestCompleted(reply: QNetworkReply, error: Optional["QNetworkReply.NetworkError"] = None, callable = None): + def _onDeleteRequestCompleted(reply: QNetworkReply, callable: Callable[[bool], None], error: Optional["QNetworkReply.NetworkError"] = None) -> None: callable(HttpRequestManager.replyIndicatesSuccess(reply, error)) diff --git a/plugins/CuraDrive/src/DrivePluginExtension.py b/plugins/CuraDrive/src/DrivePluginExtension.py index 34f30d8b3d..8de4876f52 100644 --- a/plugins/CuraDrive/src/DrivePluginExtension.py +++ b/plugins/CuraDrive/src/DrivePluginExtension.py @@ -135,7 +135,7 @@ class DrivePluginExtension(QObject, Extension): def refreshBackups(self) -> None: self._drive_api_service.getBackups(self._backupsChangedCallback) - def _backupsChangedCallback(self, backups): + def _backupsChangedCallback(self, backups: List[Dict[str, Any]]) -> None: self._backups = backups self.backupsChanged.emit() |