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

Function make_progress

tests/test_progress.py:178–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176
177
178def make_progress() -> Progress:
179 _time = 0.0
180
181 def fake_time():
182 nonlocal _time
183 try:
184 return _time
185 finally:
186 _time += 1
187
188 console = Console(
189 file=io.StringIO(),
190 force_terminal=True,
191 color_system="truecolor",
192 width=80,
193 legacy_windows=False,
194 _environ={},
195 )
196 progress = Progress(console=console, get_time=fake_time, auto_refresh=False)
197 task1 = progress.add_task("foo")
198 task2 = progress.add_task("bar", total=30)
199 progress.advance(task2, 16)
200 task3 = progress.add_task("baz", visible=False)
201 task4 = progress.add_task("egg")
202 progress.remove_task(task4)
203 task4 = progress.add_task("foo2", completed=50, start=False)
204 progress.stop_task(task4)
205 progress.start_task(task4)
206 progress.update(
207 task4, total=200, advance=50, completed=200, visible=True, refresh=True
208 )
209 progress.stop_task(task4)
210 return progress
211
212
213def render_progress() -> str:

Callers 3

test_task_idsFunction · 0.85
test_finishedFunction · 0.85
render_progressFunction · 0.85

Calls 8

add_taskMethod · 0.95
advanceMethod · 0.95
remove_taskMethod · 0.95
stop_taskMethod · 0.95
start_taskMethod · 0.95
updateMethod · 0.95
ConsoleClass · 0.90
ProgressClass · 0.90

Tested by

no test coverage detected