Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"attr", sorted([k for k, v in iteritems(COLOR_MAP) if v == "attrs"])
)
def test_attrs(attr):
sp = yaspin()
getattr(sp, attr)
assert sp.attrs == [attr]
assert sp._color_func.keywords["attrs"] == [attr]
examples.demo
~~~~~~~~~~~~~
Yaspin features demonstration.
"""
import random
import time
from yaspin import yaspin
from yaspin.compat import iteritems
from yaspin.constants import COLOR_MAP
from yaspin.spinners import Spinners
COLORS = (k for k, v in iteritems(COLOR_MAP) if v == "color")
HIGHLIGHTS = (k for k, v in iteritems(COLOR_MAP) if v == "on_color")
def any_spinner_you_like():
params = [
("line", 0.8),
("dots10", 0.8),
("dots11", 0.8),
("simpleDots", 1),
("star", 0.5),
("balloon", 0.7),
("noise", 0.5),
("arc", 0.5),
("arrow2", 0.5),
("bouncingBar", 1),
("bouncingBall", 1),
def _set_attrs(attrs):
# type: (List[str]) -> Set[str]
available_values = [k for k, v in iteritems(COLOR_MAP) if v == "attrs"]
for attr in attrs:
if attr not in available_values:
raise ValueError(
"'{0}': unsupported attribute value. "
"Use one of the: {1}".format(
attr, ", ".join(available_values)
)
)
return set(attrs)
~~~~~~~~~~~~~
Yaspin features demonstration.
"""
import random
import time
from yaspin import yaspin
from yaspin.compat import iteritems
from yaspin.constants import COLOR_MAP
from yaspin.spinners import Spinners
COLORS = (k for k, v in iteritems(COLOR_MAP) if v == "color")
HIGHLIGHTS = (k for k, v in iteritems(COLOR_MAP) if v == "on_color")
def any_spinner_you_like():
params = [
("line", 0.8),
("dots10", 0.8),
("dots11", 0.8),
("simpleDots", 1),
("star", 0.5),
("balloon", 0.7),
("noise", 0.5),
("arc", 0.5),
("arrow2", 0.5),
("bouncingBar", 1),
("bouncingBall", 1),
("smiley", 0.7),