MCPcopy Create free account
hub / github.com/Ptechgithub/configs / on_progress

Function on_progress

bot.py:5–9  ·  view source on GitHub ↗
(stream, chunk, bytes_remaining)

Source from the content-addressed store, hash-verified

3import platform
4
5def on_progress(stream, chunk, bytes_remaining):
6 total_size = stream.filesize
7 bytes_downloaded = total_size - bytes_remaining
8 percentage = (bytes_downloaded / total_size) * 100
9 print(f"Downloading : {percentage:.2f}%", end='\r')
10
11# Clear the terminal based on the OS
12if platform.system() == 'Windows':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected