MCPcopy
hub / github.com/Textualize/rich / get_default_columns

Method get_default_columns

rich/progress.py:1114–1142  ·  view source on GitHub ↗

Get the default columns used for a new Progress instance: - a text column for the description (TextColumn) - the bar itself (BarColumn) - a text column showing completion percentage (TextColumn) - an estimated-time-remaining column (TimeRemainingColumn)

(cls)

Source from the content-addressed store, hash-verified

1112
1113 @classmethod
1114 def get_default_columns(cls) -> Tuple[ProgressColumn, ...]:
1115 """Get the default columns used for a new Progress instance:
1116 - a text column for the description (TextColumn)
1117 - the bar itself (BarColumn)
1118 - a text column showing completion percentage (TextColumn)
1119 - an estimated-time-remaining column (TimeRemainingColumn)
1120 If the Progress instance is created without passing a columns argument,
1121 the default columns defined here will be used.
1122
1123 You can also create a Progress instance using custom columns before
1124 and/or after the defaults, as in this example:
1125
1126 progress = Progress(
1127 SpinnerColumn(),
1128 *Progress.get_default_columns(),
1129 "Elapsed:",
1130 TimeElapsedColumn(),
1131 )
1132
1133 This code shows the creation of a Progress display, containing
1134 a spinner to the left, the default columns, and a labeled elapsed
1135 time column.
1136 """
1137 return (
1138 TextColumn("[progress.description]{task.description}"),
1139 BarColumn(),
1140 TaskProgressColumn(),
1141 TimeRemainingColumn(),
1142 )
1143
1144 @property
1145 def console(self) -> Console:

Callers 3

__init__Method · 0.95
progress.pyFile · 0.80

Calls 4

TextColumnClass · 0.85
BarColumnClass · 0.85
TaskProgressColumnClass · 0.85
TimeRemainingColumnClass · 0.85

Tested by 1