(destFile, error)
| 222 | ) |
| 223 | |
| 224 | def errorCb(destFile, error): |
| 225 | if error == 'cancelled': |
| 226 | em.fire( |
| 227 | Events.CLOUD_DOWNLOAD, |
| 228 | { |
| 229 | "type": "cancelled", |
| 230 | "id": print_file_id |
| 231 | } |
| 232 | ) |
| 233 | else: |
| 234 | em.fire( |
| 235 | Events.CLOUD_DOWNLOAD, |
| 236 | { |
| 237 | "type": "error", |
| 238 | "id": print_file_id, |
| 239 | "reason": error |
| 240 | } |
| 241 | ) |
| 242 | |
| 243 | if destFile and os.path.exists(destFile): |
| 244 | os.remove(destFile) |
| 245 | |
| 246 | if astroprintCloud().download_print_file(print_file_id, progressCb, successCb, errorCb) is True: |
| 247 | return jsonify(SUCCESS) |
no test coverage detected