mirror of
https://github.com/not-kennethreitz/blindspin.git
synced 2026-06-05 23:10:18 +00:00
blindspin
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
# Click Spinner
|
||||
|
||||
[](https://pypi.python.org/pypi/click-spinner/) [](https://travis-ci.org/click-contrib/click-spinner)
|
||||
|
||||
Sometimes you would just like to show the user some progress,
|
||||
but a progress bar is not suitable because you don’t know how much longer it would take.
|
||||
In these cases you might want to display a simple spinner using the `spinner()` function.
|
||||
|
||||
Example usage:
|
||||
|
||||
```py
|
||||
with click_spinner.spinner():
|
||||
do_something()
|
||||
do_something_else()
|
||||
```
|
||||
|
||||
It looks like this:
|
||||
|
||||

|
||||
|
||||
Spinner class based on on a [gist by @cevaris](https://gist.github.com/cevaris/79700649f0543584009e).
|
||||
|
||||
Introduced in [PR #649](https://github.com/pallets/click/pull/649).
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
pip install click-spinner
|
||||
```
|
||||
|
||||
Supports Python 2.7 and 3.
|
||||
|
||||
## Authors
|
||||
|
||||
- Yoav Ram (@yoavram)
|
||||
- Andreas Maier (@andy-maier)
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
BlindSpin: Braille Spinner for Python
|
||||
=====================================
|
||||
|
||||
Sometimes you would just like to show the user some progress,
|
||||
but a progress bar is not suitable because you don’t know how much longer it would take.
|
||||
In these cases you might want to display a simple spinner using the `spinner()` function.
|
||||
|
||||
Example usage::
|
||||
|
||||
with blindspin.spinner():
|
||||
do_something()
|
||||
do_something_else()
|
||||
|
||||
|
||||
It looks like this:
|
||||
|
||||
insert gif here
|
||||
|
||||
Spinner class based on on a [gist by @cevaris](https://gist.github.com/cevaris/79700649f0543584009e).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
pip install blindspin
|
||||
```
|
||||
|
||||
Supports Python 2.7 and 3.
|
||||
|
||||
## Based on the work of:
|
||||
|
||||
- Yoav Ram (@yoavram)
|
||||
- Andreas Maier (@andy-maier)
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
@@ -5,7 +7,7 @@ import itertools
|
||||
|
||||
|
||||
class Spinner(object):
|
||||
spinner_cycle = itertools.cycle('⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏')
|
||||
spinner_cycle = itertools.cycle(u'⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏')
|
||||
|
||||
def __init__(self, beep=False, force=False):
|
||||
self.beep = beep
|
||||
@@ -28,7 +30,7 @@ class Spinner(object):
|
||||
while not self.stop_running.is_set():
|
||||
sys.stdout.write(next(self.spinner_cycle))
|
||||
sys.stdout.flush()
|
||||
time.sleep(0.25)
|
||||
time.sleep(0.07)
|
||||
sys.stdout.write('\b')
|
||||
|
||||
def __enter__(self):
|
||||
@@ -1,17 +0,0 @@
|
||||
[bdist_wheel]
|
||||
universal=1
|
||||
|
||||
[metadata]
|
||||
description-file = README.md
|
||||
# See the docstring in versioneer.py for instructions. Note that you must
|
||||
# re-run 'versioneer.py setup' after changing this section, and commit the
|
||||
# resulting files.
|
||||
|
||||
[versioneer]
|
||||
VCS = git
|
||||
style = pep440
|
||||
versionfile_source = click_spinner/_version.py
|
||||
versionfile_build = click_spinner/_version.py
|
||||
tag_prefix = v
|
||||
parentdir_prefix = click-spinner-
|
||||
|
||||
Reference in New Issue
Block a user