Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "kB" for DownloadColumn #1986

Merged
merged 1 commit into from Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion rich/progress.py
Expand Up @@ -427,7 +427,9 @@ def render(self, task: "Task") -> Text:
)
else:
unit, suffix = filesize.pick_unit_and_suffix(
total, ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], 1000
total,
["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
1000,
)
completed_ratio = completed / unit
total_ratio = total / unit
Expand Down
2 changes: 1 addition & 1 deletion tests/test_progress.py
Expand Up @@ -123,7 +123,7 @@ def test_download_progress_uses_decimal_units() -> None:
column = DownloadColumn()
test_task = Task(1, "test", 1000, 500, _get_time=lambda: 1.0)
rendered_progress = str(column.render(test_task))
expected = "0.5/1.0 KB"
expected = "0.5/1.0 kB"
assert rendered_progress == expected


Expand Down