Code review changes

This commit is contained in:
Andres Caicedo
2023-04-09 15:39:11 +02:00
parent 54cbf1cae1
commit 011699e6a1
18 changed files with 28 additions and 98 deletions

View File

@@ -14,7 +14,6 @@ class Spinner:
self.running = False
self.spinner_thread = None
def spin(self):
"""Spin the spinner"""
while self.running:
@@ -23,14 +22,12 @@ class Spinner:
time.sleep(self.delay)
sys.stdout.write('\b' * (len(self.message) + 2))
def __enter__(self):
"""Start the spinner"""
self.running = True
self.spinner_thread = threading.Thread(target=self.spin)
self.spinner_thread.start()
def __exit__(self, exc_type, exc_value, exc_traceback):
"""Stop the spinner"""
self.running = False