How to use the yaspin.constants.COLOR_MAP function in yaspin

To help you get started, we’ve selected a few yaspin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pavdmyt / yaspin / tests / test_attrs.py View on Github external
    "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]
github pavdmyt / yaspin / examples / demo.py View on Github external
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),
github pavdmyt / yaspin / yaspin / core.py View on Github external
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)
github pavdmyt / yaspin / examples / demo.py View on Github external
~~~~~~~~~~~~~

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),