MCPcopy
hub / github.com/treeverse/dvc / progress_iter

Function progress_iter

dvc/repo/add.py:119–135  ·  view source on GitHub ↗
(stages: dict[str, StageInfo])

Source from the content-addressed store, hash-verified

117
118
119def progress_iter(stages: dict[str, StageInfo]) -> Iterator[tuple[str, StageInfo]]:
120 total = len(stages)
121 desc = "Adding..."
122 with ui.progress(
123 stages.items(), total=total, desc=desc, unit="file", leave=True
124 ) as pbar:
125 if total == 1:
126 pbar.bar_format = desc
127 pbar.refresh()
128
129 for item, stage_info in pbar:
130 if total > 1:
131 pbar.set_msg(str(stage_info.stage.outs[0]))
132 pbar.refresh()
133 yield item, stage_info
134 if total == 1: # restore bar format for stats
135 pbar.bar_format = pbar.BAR_FMT_DEFAULT
136
137
138LINK_FAILURE_MESSAGE = (

Callers 1

addFunction · 0.85

Calls 3

itemsMethod · 0.80
set_msgMethod · 0.80
progressMethod · 0.45

Tested by

no test coverage detected