MCPcopy
hub / github.com/Comfy-Org/ComfyUI-Manager / msg_capture

Function msg_capture

comfyui_manager/prestartup_script.py:544–563  ·  view source on GitHub ↗
(stream, prefix)

Source from the content-addressed store, hash-verified

542 cloned_repos = []
543
544 def msg_capture(stream, prefix):
545 stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
546 for msg in stream:
547 if msg.startswith("CLONE: "):
548 cloned_repos.append(msg[7:])
549 if prefix == '[!]':
550 print(prefix, msg, end="", file=sys.stderr)
551 else:
552 print(prefix, msg, end="")
553
554 elif prefix == '[!]' and ('it/s]' in msg or 's/it]' in msg) and ('%|' in msg or 'it [' in msg):
555 if msg.startswith('100%'):
556 print('\r' + msg, end="", file=sys.stderr),
557 else:
558 print('\r'+msg[:-1], end="", file=sys.stderr),
559 else:
560 if prefix == '[!]':
561 print(prefix, msg, end="", file=sys.stderr)
562 else:
563 print(prefix, msg, end="")
564
565 print("[ComfyUI-Manager] Restore snapshot.")
566 new_env = os.environ.copy()

Callers

nothing calls this directly

Calls 2

reconfigureMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected