Skip to content

How to do stuff when using as a decorator? #210

Answered by pavdmyt
3cha1n asked this question in Q&A
Discussion options

You must be logged in to vote

Spinner instance is not passed inside of the decorated function as of now: https://github.com/pavdmyt/yaspin/blob/master/yaspin/core.py#L109, so it is not possible to modify spinner attributes when using it as a decorator.

Technically it should be easy to pass spinner instance inside the function via e.g. pre-defined spinner argument. This is the first thing that came to my mind, have to think more carefully if better API is possible for this use-case.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@3cha1n
Comment options

Answer selected by pavdmyt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants