You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a case where e.g. multiple downloads are taking place where the files are of vastly different sizes, it would be useful for the width used in MofNCompleteColumn could be overridden with the largest file size:
classMofNCompleteColumn(ProgressColumn):
"""Renders completed count/total, e.g. ' 10/1000'. Best for bounded tasks with int quantities. Space pads the completed count so that progress length does not change as task progresses past powers of 10. Args: separator (str, optional): Text to separate completed and total values. Defaults to "/". width (int, optional): A minimum width to apply for the step formatting. Defaults to 0. Useful when multiple tasks with very different totals are present. """def__init__(self, separator: str="/", table_column: Optional[Column] =None, width: Optional[int] =0):
self.separator=separatorself.width=widthsuper().__init__(table_column=table_column)
defrender(self, task: "Task") ->Text:
"""Show completed/total."""completed=int(task.completed)
total=int(task.total) iftask.totalisnotNoneelse"?"total_width=max(self.width, len(str(total)))
returnText(
f"{completed:{total_width}d}{self.separator}{total:{total_width}d}",
style="progress.download",
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In a case where e.g. multiple downloads are taking place where the files are of vastly different sizes, it would be useful for the width used in
MofNCompleteColumn
could be overridden with the largest file size:Beta Was this translation helpful? Give feedback.
All reactions