MCPcopy
hub / github.com/pallets/click / make_step

Method make_step

src/click/_termui_impl.py:302–322  ·  view source on GitHub ↗
(self, n_steps: int)

Source from the content-addressed store, hash-verified

300 self.file.flush()
301
302 def make_step(self, n_steps: int) -> None:
303 self.pos += n_steps
304 if self.length is not None and self.pos >= self.length:
305 self.finished = True
306
307 if (time.time() - self.last_eta) < 1.0:
308 return
309
310 self.last_eta = time.time()
311
312 # self.avg is a rolling list of length <= 7 of steps where steps are
313 # defined as time elapsed divided by the total progress through
314 # self.length.
315 if self.pos:
316 step = (time.time() - self.start) / self.pos
317 else:
318 step = time.time() - self.start
319
320 self.avg = self.avg[-6:] + [step]
321
322 self.eta_known = self.length is not None
323
324 def update(self, n_steps: int, current_item: V | None = None) -> None:
325 """Update the progress bar by advancing a specified number of

Callers 1

updateMethod · 0.95

Calls 1

timeMethod · 0.80

Tested by

no test coverage detected