Skip to content

Commit

Permalink
Clean out spinner character when done.
Browse files Browse the repository at this point in the history
Details:
- The loop that writes the spinner characters already attempts to
  have a clean output when the spinner is sopped, by ending with
  the backslash character. However, there was no flush after the
  write of the backslash, so that the last spinner character
  could still be seen. This change adds a flush after the
  writing of the backslash.

Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
Andreas Maier committed Feb 6, 2017
1 parent df4442d commit 51be1a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions click_spinner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def init_spin(self):
sys.stdout.flush()
time.sleep(0.25)
sys.stdout.write('\b')
sys.stdout.flush()

def __enter__(self):
self.start()
Expand Down

0 comments on commit 51be1a0

Please sign in to comment.