How to use the yaspin.signal_handlers.fancy_handler 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 / examples / basic_usage.py View on Github external
def pre_setup_example():
    swirl = yaspin(
        spinner=Spinners.simpleDotsScrolling,
        text="swirl",
        color="red",
        side="right",
        sigmap={signal.SIGINT: fancy_handler},
    )

    with swirl as sp:
        time.sleep(2)

    with swirl as sp:
        sp.text = "new swirl"
        sp.reversal = True
        time.sleep(2)
github pavdmyt / yaspin / examples / signals.py View on Github external
def fancy_keyboard_interrupt_handler():
    with yaspin(sigmap={signal.SIGINT: fancy_handler}, text=DEFAULT_TEXT):
        time.sleep(5)