2021.4 #19
@ -251,7 +251,7 @@ class Console:
|
|||||||
cls._output(string, x, y, end='')
|
cls._output(string, x, y, end='')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def spinner(cls, message: str, call: Callable) -> any:
|
def spinner(cls, message: str, call: Callable, *args) -> any:
|
||||||
if cls._hold_back:
|
if cls._hold_back:
|
||||||
cls._hold_back_calls.append(ConsoleCall(cls.spinner, message, call))
|
cls._hold_back_calls.append(ConsoleCall(cls.spinner, message, call))
|
||||||
return
|
return
|
||||||
@ -260,7 +260,7 @@ class Console:
|
|||||||
cls.set_hold_back(True)
|
cls.set_hold_back(True)
|
||||||
spinner = SpinnerThread()
|
spinner = SpinnerThread()
|
||||||
spinner.start()
|
spinner.start()
|
||||||
return_value = call()
|
return_value = call(*args)
|
||||||
spinner.stop_spinning()
|
spinner.stop_spinning()
|
||||||
cls.set_hold_back(False)
|
cls.set_hold_back(False)
|
||||||
for call in cls._hold_back_calls:
|
for call in cls._hold_back_calls:
|
||||||
|
Loading…
Reference in New Issue
Block a user