-
-
Notifications
You must be signed in to change notification settings - Fork 90
library: Port Actions demo to Python #705
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
Conversation
If it's only a single statement, it's fine to use lambdas IMO |
sonnyp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it to @theCapypara to review his first Workbench PR :)
@rolandlo thanks! please consider adding yourself to the list of contributors in about.js
|
@theCapypara please do make sure to test the code, pasting the code directly into Workbench is the most efficient way for ports |
d579118 to
a4e2878
Compare
Done! |
theCapypara
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! In general this looks good and works perfectly, however could you make sure your code is formatted to follow PEP 8 and uses 4 spaces for indentation?
You can use pycodestyle to verify. You can ignore error E402 module level import not at top of file, since that isn't possible due to the require_version.
Also we may want to change the demo's blueprint file to also link to the PyGObject docs (or remove the GJS link), what do you think @sonnyp?
src/Library/demos/Actions/main.py
Outdated
|
|
||
| # Action with parameter | ||
| bookmarks_action = Gio.SimpleAction( | ||
| name = "open-bookmarks", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One example for PEP 8 is that there should be no spaces around the = in keyword arguments.
Done! It would be good to add these style requirements to the style guide, so everybody can learn about them without going through previous PR's.
I have added a commit adding that link. Let me know if I should remove the commit (or make changes to it). Back to:
Is it only for me that the links from the bookmarks don't work (the links are not opened) with the Python code and the Actions Documentation section is disabled? |
|
Oh, that's very odd, I somehow didn't even notice that the first time around.
|
|
Oh wow, wait, disregard my previous comment even though I double and tripple checked before sending (and was very confused how this is even possible) I just was off by one line. That is the text. |
|
Okay this is not a bug in PyGObject, this is a general issue with the way the external previewers work at the moment: #715 |
|
Should I squash all the commits (or at least the first two commits) into one? |
|
Converting to draft until #715 is solved. |
No need, our default merging strategy is "Squash and merge" |
|
Ok then, let's squash and merge. |
|
@rolandlo please don't merge PRs. It is a task for maintainers. Feel free to create branches though. |


This PR ports the Actions demo to Python
I have tried to stay as close as possible to the JS code. Not sure if I should have avoided using lambdas as in the Welcome demo, see comment. I used lambdas because here it's only for a single statement, whereas in the Welcome demo there were two statements.
The
open_uriactions somehow don't work yet. Is this something that needs to be fixed on the "core" side or is there something wrong with my code?