Helpers
helpers ¶
Compatibility exports for the download helper layer.
DownloadReporter ¶
Bases: ABC
Abstract progress reporter for file downloads.
add_file
abstractmethod
¶
add_file(name: str, total: Optional[int]) -> Any
Register a file and return an opaque handle used for later updates.
Source code in eos_downloader/helpers/progress.py
39 40 41 | |
advance
abstractmethod
¶
advance(handle: Any, n_bytes: int) -> None
Report that n_bytes more bytes of handle have been written.
Source code in eos_downloader/helpers/progress.py
43 44 45 | |
complete
abstractmethod
¶
complete(handle: Any) -> None
Mark the file identified by handle as finished.
Source code in eos_downloader/helpers/progress.py
47 48 49 | |
NoopReporter ¶
PlainReporter ¶
PlainReporter()
Bases: DownloadReporter
ANSI-free reporter emitting loguru lifecycle lines.
Source code in eos_downloader/helpers/progress.py
138 139 140 141 | |
RichReporter ¶
RichReporter(console: Console, title: str = 'Downloading')
Bases: DownloadReporter
Animated grouped display for interactive terminals.
Source code in eos_downloader/helpers/progress.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
download_files_concurrently ¶
download_files_concurrently(
items: Iterable[DownloadItem],
reporter: DownloadReporter,
*,
max_workers: int = 4,
block_size: int = 1024
) -> None
Download several files in parallel, updating a single shared reporter.
Source code in eos_downloader/helpers/transfer.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
resolve_reporter ¶
resolve_reporter(
mode: ProgressMode,
console: Console,
*,
title: str = "Downloading"
) -> DownloadReporter
Build the concrete reporter for a progress mode and console.
Source code in eos_downloader/helpers/progress.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
sigint_guard ¶
sigint_guard(done_event: Event) -> Iterator[None]
Route SIGINT to a done event, then defer to the previous handler.
Source code in eos_downloader/helpers/signals.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |