From d16b9eca4571aad801e5daa263d8a9aad9be8a78 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Sun, 21 Jul 2024 22:43:58 +0000 Subject: [PATCH] Fix spinner --- sky/utils/rich_utils.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sky/utils/rich_utils.py b/sky/utils/rich_utils.py index b8d85e874d0..02345d0cf7d 100644 --- a/sky/utils/rich_utils.py +++ b/sky/utils/rich_utils.py @@ -45,24 +45,28 @@ class EncodedStatus: def __init__(self, msg: str): self.msg = msg - print(common_utils.encode_payload(Control.INIT.encode(self.msg))) + print(common_utils.encode_payload(Control.INIT.encode(self.msg)), + flush=True) def __enter__(self): - print(common_utils.encode_payload(Control.START.encode(self.msg))) + print(common_utils.encode_payload(Control.START.encode(self.msg)), + flush=True) return self def __exit__(self, exc_type, exc_val, exc_tb): - print(common_utils.encode_payload(Control.STOP.encode(''))) + print(common_utils.encode_payload(Control.STOP.encode('')), flush=True) def update(self, msg: str): - print(common_utils.encode_payload(Control.UPDATE.encode(msg))) + print(common_utils.encode_payload(Control.UPDATE.encode(msg)), + flush=True) self.msg = msg def stop(self): - print(common_utils.encode_payload(Control.STOP.encode(''))) + print(common_utils.encode_payload(Control.STOP.encode('')), flush=True) def start(self): - print(common_utils.encode_payload(Control.START.encode(self.msg))) + print(common_utils.encode_payload(Control.START.encode(self.msg)), + flush=True) class _NoOpConsoleStatus: