Skip to content

Commit

Permalink
Fix spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Jul 21, 2024
1 parent 94cc2a9 commit d16b9ec
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sky/utils/rich_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d16b9ec

Please sign in to comment.