MCPcopy Create free account
hub / github.com/OpenPipe/ART / demo_progress_tracking

Function demo_progress_tracking

dev/demo_logging.py:99–120  ·  view source on GitHub ↗

Demonstrate progress tracking with logging.

()

Source from the content-addressed store, hash-verified

97
98
99def demo_progress_tracking():
100 """Demonstrate progress tracking with logging."""
101 print("=" * 60)
102 print("PROGRESS TRACKING EXAMPLE")
103 print("=" * 60)
104
105 total_items = 5
106 info(f"Processing {total_items} items")
107
108 for i in range(1, total_items + 1):
109 step(f"Processing item {i}/{total_items}")
110 time.sleep(0.2) # Simulate work
111
112 if i == 3:
113 warn(f"Item {i} required additional validation")
114
115 ok(f"Item {i} completed")
116 dim(f" Progress: {i}/{total_items} ({i / total_items * 100:.0f}%)")
117
118 ok("All items processed successfully")
119
120 print()
121
122
123def demo_error_scenarios():

Callers 1

mainFunction · 0.85

Calls 5

infoFunction · 0.90
stepFunction · 0.90
warnFunction · 0.90
okFunction · 0.90
dimFunction · 0.90

Tested by

no test coverage detected