2021.4 #19
@ -206,13 +206,15 @@ class Console:
|
|||||||
cls._output(string, x, y, end='')
|
cls._output(string, x, y, end='')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def spinner(cls, message: str, call: Callable):
|
def spinner(cls, message: str, call: Callable) -> any:
|
||||||
cls.write_line(message)
|
cls.write_line(message)
|
||||||
spinner = SpinnerThread(cls)
|
spinner = SpinnerThread(cls)
|
||||||
spinner.start()
|
spinner.start()
|
||||||
call()
|
return_value = call()
|
||||||
spinner.stop_spinning()
|
spinner.stop_spinning()
|
||||||
|
|
||||||
|
return return_value
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def flush(cls):
|
def flush(cls):
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
Loading…
Reference in New Issue
Block a user