Make printing progress a bit more readable

This commit is contained in:
Ivan Habunek 2024-04-12 09:43:04 +02:00
parent 0d3c3df2f8
commit e50499351b
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D

View File

@ -136,17 +136,20 @@ class Progress:
if now - self.last_printed < 0.1: if now - self.last_printed < 0.1:
return return
progress = " ".join( click.echo(f"\rDownloaded {self.vod_downloaded_count}/{self.vod_count} VODs", nl=False)
[ click.secho(f" {self.progress_perc}%", fg="blue", nl=False)
f"Downloaded {self.vod_downloaded_count}/{self.vod_count} VODs",
f"{blue(self.progress_perc)}%", if self.estimated_total is not None:
f"of ~{blue(format_size(self.estimated_total))}" if self.estimated_total else "", total = f"~{format_size(self.estimated_total)}"
f"at {blue(format_size(self.speed))}/s" if self.speed else "", click.echo(f" of {blue(total)}", nl=False)
f"ETA {blue(format_time(self.remaining_time))}"
if self.remaining_time is not None if self.speed is not None:
else "", speed = f"{format_size(self.speed)}/s"
] click.echo(f" at {blue(speed)}", nl=False)
)
if self.remaining_time is not None:
click.echo(f" ETA {blue(format_time(self.remaining_time))}", nl=False)
click.echo(" ", nl=False)
click.echo(f"\r{progress} ", nl=False)
self.last_printed = now self.last_printed = now