(record: dict[str, Any])
| 386 | |
| 387 | |
| 388 | def _download_info_from_record(record: dict[str, Any]) -> DownloadInfo: |
| 389 | info = DownloadInfo.__new__(DownloadInfo) |
| 390 | info.__setstate__({key: from_json_compatible(value) for key, value in record.items()}) |
| 391 | if not hasattr(info, "msg"): |
| 392 | info.msg = None |
| 393 | if not hasattr(info, "percent"): |
| 394 | info.percent = None |
| 395 | if not hasattr(info, "speed"): |
| 396 | info.speed = None |
| 397 | if not hasattr(info, "eta"): |
| 398 | info.eta = None |
| 399 | if not hasattr(info, "status"): |
| 400 | info.status = "pending" |
| 401 | if not hasattr(info, "size"): |
| 402 | info.size = None |
| 403 | if not hasattr(info, "error"): |
| 404 | info.error = None |
| 405 | return info |
| 406 | |
| 407 | class Download: |
| 408 | manager = None |
no test coverage detected