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

Change some exceptions to return values #144

Merged
merged 2 commits into from
Mar 13, 2024
Merged

Change some exceptions to return values #144

merged 2 commits into from
Mar 13, 2024

Conversation

flacjacket
Copy link
Owner

Modify Backend.start and Output.commit to return boolean values rather than checking the return value and raising an error. Move the logic for the Pythonic APIs into the Python-specific functions, in particular the __enter__ and __exit__ so these objects will be well behaved when using the context manager.

Closes #135
Closes #136

Modify `Backend.start` and `Output.commit` to return boolean values
rather than checking the return value and raising an error. Move the
logic for the Pythonic APIs into the Python-specific functions, in
particular the `__enter__` and `__exit__` so these objects will be well
behaved when using the context manager.

Closes #135
Closes #136
@flacjacket
Copy link
Owner Author

@heuer Let me know if you think this would address your tickets!

@heuer
Copy link
Contributor

heuer commented Mar 10, 2024

Thanks, looks good to me.

I am not sure if if not self.test(): self.rollback() is necessary (line 163), though.
The wlr-docs mention in the description of the wlr_output_commit function:

[…] On failure, the pending changes are rolled back. […]

So wlroots should do the right thing (rollback) without the check?

@heuer heuer mentioned this pull request Mar 12, 2024
@flacjacket flacjacket merged commit 371ca85 into main Mar 13, 2024
70 checks passed
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.

Proposal. Backend.start should return a boolean value Output.commit(): Return boolean?
2 participants