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

Make steps and loops more pythonic using decorators #101

Open
maartenuni opened this issue Feb 5, 2024 · 0 comments
Open

Make steps and loops more pythonic using decorators #101

maartenuni opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request python Labels for issues related to python bindings

Comments

@maartenuni
Copy link
Contributor

This is perhaps an idea to make psylib get a more pythonic feel:

Create decorators for stepping stones and loops:

@Loop(0, 10, 1, Psy.LoopCondition.LESS)
def on_iteration():
    pass

stones = Psy.SteppingStones()

@stones.on_enter
def my_callback():
    stones.activate_next_by_name('blue')

@stone.on_leave
def stone_on_leave():
    pass

This is perhaps better done in Python helper scripts than from psylib itself.

@maartenuni maartenuni added enhancement New feature or request python Labels for issues related to python bindings labels Feb 5, 2024
@maartenuni maartenuni self-assigned this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Labels for issues related to python bindings
Projects
None yet
Development

No branches or pull requests

1 participant