MCPcopy Create free account
hub / github.com/apache/trafficserver / progressbar

Function progressbar

tools/records/convert2yaml.py:94–108  ·  view source on GitHub ↗
(it, size=60, out=sys.stdout, mute=False)

Source from the content-addressed store, hash-verified

92
93
94def progressbar(it, size=60, out=sys.stdout, mute=False):
95 count = len(it)
96
97 def show(j):
98 x = int(size * j / count)
99 if not mute:
100 print("[{}{}] {}/{}".format("█" * x, "░" * (size - x), j, count), end='\r', file=out, flush=True)
101
102 show(0)
103 for i, item in enumerate(it):
104 yield item
105
106 show(i + 1)
107 if not mute:
108 print("\n", flush=True, file=out)
109
110
111def validate_schema(data, schema_filename):

Callers 1

handle_file_inputFunction · 0.85

Calls 1

showFunction · 0.85

Tested by

no test coverage detected