Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hidden() to hide spinner in with-block #68

Merged
merged 1 commit into from Aug 13, 2020

Conversation

sebageek
Copy link
Contributor

@sebageek sebageek commented Aug 5, 2020

With hidden() the spinner can be hidden in a with-block. This allows us
to write the following code:

sp.hide()
call_cli_menu()
sp.unhide()

as follows:

with sp.hidden():
    call_cli_menu()

hidden() can be nested, therefore the following works:

with sp.hidden():
    # generating some output
    ...
    with sp.hidden():
        # generating more output
        ...

@pavdmyt
Copy link
Owner

pavdmyt commented Aug 5, 2020

Hi @sebageek

Thanks for PR!

I'll review it as soon as possible (probably this weekend). Also, check CI status here (it is disappeared from PR for unknown reasons): https://travis-ci.org/github/pavdmyt/yaspin/builds/715132078

@pavdmyt pavdmyt self-assigned this Aug 5, 2020
tests/test_in_out.py Outdated Show resolved Hide resolved
tests/test_in_out.py Outdated Show resolved Hide resolved
yaspin/core.py Show resolved Hide resolved
With hidden() the spinner can be hidden in a with-block. This allows us
to write the following code:

    sp.hide()
    call_cli_menu()
    sp.unhide()

as follows:

    with sp.hidden():
        call_cli_menu()

hidden() can be nested, therefore the following works:

    with sp.hidden():
        # generating some output
        ...
        with sp.hidden():
            # generating more output
            ...
@pavdmyt pavdmyt merged commit 705e555 into pavdmyt:master Aug 13, 2020
@pavdmyt
Copy link
Owner

pavdmyt commented Aug 13, 2020

@sebageek will include this feature into the next release. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants