Improved spinner
This commit is contained in:
@@ -75,11 +75,10 @@ class Console:
|
||||
|
||||
args = []
|
||||
colored_args = []
|
||||
|
||||
if x is not None and y is not None:
|
||||
args.append(f'\033[{x};{y}H')
|
||||
args.append(f'\033[{y};{x}H')
|
||||
elif cls._x is not None and cls._y is not None:
|
||||
args.append(f'\033[{cls._x};{cls._y}H')
|
||||
args.append(f'\033[{cls._y};{cls._x}H')
|
||||
|
||||
colored_args.append(string)
|
||||
if cls._foreground_color != ForegroundColor.default and cls._background_color == BackgroundColor.default:
|
||||
@@ -96,7 +95,6 @@ class Console:
|
||||
"""
|
||||
Useful public methods
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def banner(cls, string: str):
|
||||
if cls._disabled:
|
||||
|
@@ -17,11 +17,13 @@ class SpinnerThread(threading.Thread):
|
||||
yield cursor
|
||||
|
||||
def run(self) -> None:
|
||||
self._console.write('\t')
|
||||
spinner = self._spinner()
|
||||
while self._is_spinning:
|
||||
self._console.write(next(spinner))
|
||||
time.sleep(0.1)
|
||||
self._console.write('\b')
|
||||
|
||||
self._console.flush()
|
||||
|
||||
self._console.write(' ')
|
||||
|
Reference in New Issue
Block a user