mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-27 23:30:52 +08:00
fix: git_helper's tqdm encoding error
This commit is contained in:
parent
ec61a3029f
commit
332e4e2856
15
__init__.py
15
__init__.py
@ -11,14 +11,23 @@ import subprocess # don't remove this
|
|||||||
from tqdm.auto import tqdm
|
from tqdm.auto import tqdm
|
||||||
|
|
||||||
|
|
||||||
version = "V0.39.2"
|
version = "V0.39.3"
|
||||||
print(f"### Loading: ComfyUI-Manager ({version})")
|
print(f"### Loading: ComfyUI-Manager ({version})")
|
||||||
|
|
||||||
|
|
||||||
def handle_stream(stream, prefix):
|
def handle_stream(stream, prefix):
|
||||||
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
||||||
for line in stream:
|
for msg in stream:
|
||||||
print(prefix, line, end="")
|
if prefix == '[!]' and ('it/s]' in msg or 's/it]' in msg) and ('%|' in msg or 'it [' in msg):
|
||||||
|
if msg.startswith('100%'):
|
||||||
|
print('\r' + msg, end="", file=sys.stderr),
|
||||||
|
else:
|
||||||
|
print('\r' + msg[:-1], end="", file=sys.stderr),
|
||||||
|
else:
|
||||||
|
if prefix == '[!]':
|
||||||
|
print(prefix, msg, end="", file=sys.stderr)
|
||||||
|
else:
|
||||||
|
print(prefix, msg, end="")
|
||||||
|
|
||||||
|
|
||||||
def run_script(cmd, cwd='.'):
|
def run_script(cmd, cwd='.'):
|
||||||
|
|||||||
@ -16,7 +16,7 @@ working_directory = os.getcwd()
|
|||||||
class GitProgress(RemoteProgress):
|
class GitProgress(RemoteProgress):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.pbar = tqdm()
|
self.pbar = tqdm(ascii=True)
|
||||||
|
|
||||||
def update(self, op_code, cur_count, max_count=None, message=''):
|
def update(self, op_code, cur_count, max_count=None, message=''):
|
||||||
self.pbar.total = max_count
|
self.pbar.total = max_count
|
||||||
|
|||||||
@ -28,7 +28,7 @@ git_script_path = os.path.join(comfyui_manager_path, "git_helper.py")
|
|||||||
def handle_stream(stream, prefix):
|
def handle_stream(stream, prefix):
|
||||||
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
stream.reconfigure(encoding=locale.getpreferredencoding(), errors='replace')
|
||||||
for msg in stream:
|
for msg in stream:
|
||||||
if prefix == '[!]' and ('it/s]' or 's/it]') in msg and ('%|' in msg or 'it [' in msg):
|
if prefix == '[!]' and ('it/s]' in msg or 's/it]' in msg) and ('%|' in msg or 'it [' in msg):
|
||||||
if msg.startswith('100%'):
|
if msg.startswith('100%'):
|
||||||
print('\r' + msg, end="", file=sys.stderr),
|
print('\r' + msg, end="", file=sys.stderr),
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user