-
Notifications
You must be signed in to change notification settings - Fork 18
geanypy: convert to a proxy plugin #37
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
|
@codebrainz ping. I want this for G-P 1.26. But not only this, I have keybindings support in the works too, so we gotta hurry a bit. Both would make geanypy truly useful. |
c0dbbd5 to
32bddb8
Compare
|
@kugel- does this require any change to any existing Python plugin for it to continue working? |
|
Am 7. November 2015 02:20:03 MEZ, schrieb elextr notifications@github.com:
@elextr all existing plugins continue to work as-is, without any changes. The only thing is that their configure implementation needs to be updated, and until then you cannot configure them (from single configure to the combined one). But they can read their existing configuration and still function as before |
@kugel- so unless changed they don't work properly. Its not appropriate to just commit this change then, since it will break all existing Python plugins without warning. Python plugin authors need time to convert their plugins. Since the new system is a big improvement there is some incentive to do so, but its inappropriate to force them to do so instantly. And the user may not be the author. There seems to be two possible options:
|
|
Oh god, the single configure is deprecated since eternity. Yet we shall still implement workarounds for those? |
|
Am 7. November 2015 12:03:50 MEZ, schrieb elextr notifications@github.com:
To be honest, it's not your decision how important compatibility is. It's still @codebrainz plugin and he makes the decision. Besides, IMO compatibility is sufficiently given. And since there is no larger distribution there shouldn't be lot of users affected at all (I expect that mostly the developer is the only user).
There is nothing that prevents both be active simultaneously. And then you have a hard time to determine which version of geanypy should handle a script (basically impossible).
There is no way this can be achieved. The new_hooks system only supports the combined configure. This cannot be made work with python scripts that create and run their own configure dialog. |
|
On 7 November 2015 at 21:41, Thomas Martitz notifications@github.com
I thought you could only have one copy of Python active in a process at
|
src/geanypy-plugin.c
Outdated
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.
The last param needs to be casted to GDestroyNotify to stifle a warning.
They could in theory share the same Python by each calling |
I don't see why we can't do stuff upstream, especially since it no longer provides releases, per se. If people want to wait a while before importing changes into the GP fork, they can wait as long as desired, or implement a duplicate plugin or whatever. I tend to agree this shouldn't be in 1.26, at the very least we should send an announcement to the mailing lists to let people know in next release their plugin scripts won't continue to work out-of-the-box and they need modifications. That being said, GeanyPy never really promised any API stability/compatibility guarantees, and it shouldn't since it's still a work-in-progress (ex. needs re-working for GTK3 and Python 3), and it wouldn't be ideal to lock ourselves into API guarantees without any user demand/complaints or anything. |
|
There is some documentation in https://geanypy.readthedocs.org/en/latest/ IIRC it's generated automatically from Git, so just updating the in-tree docs should do. |
|
I'm OK if you want to merge this if you don't mind the changes in the PR I made on your fork. As mentioned in a comment, I'd like to combine Edit: and also updating the docs :) |
|
On 8 November 2015 at 13:01, Matthew Brush notifications@github.com wrote:
Of course, but it was my understanding that you had a script that synced
I'll look at adding a warning to G-P geanypy README so it will also show
Sure, but as you say, at least tell people about it :)
|
You're probably thinking of the Overview plugin: https://github.com/codebrainz/overview-plugin/blob/master/gp-update.sh |
|
@codebrainz i pushed a new version that doesn't introduce a new type, thus simplifed (thanks for the hint to store the pointer in a class-instance space). |
|
@codebrainz I added one commit that adds your desired compatibility. Hope it's fine now. |
|
@kugel- cool, I'll have a look when I get some time. |
|
@kugel- @codebrainz Hello people. I couldn't know if this is the place to discuss this. I have a plugin https://github.com/sagarchalise/geanypy-emmet . I tried using keybindings feature but am getting this traceback with segmentation fault. The code used is in https://github.com/sagarchalise/geanypy-emmet/tree/proxy |
|
@codebrainz will you ever look at this? |
|
@sagarchalise you must be running an old version. the backtrace mentions geanypy-plugin.c, line 421. That doesn't exist in the latest patch set. |
|
@kugel- I still get I am testing this with a gtk3 build https://github.com/sagarchalise/geanypy/tree/proxy-gtk3. Is it due to that as well ? |
|
@sagarchalise your fork is out of date w.r.t. to this patch set. Please update. @codebrainz please look at this. I think I'll push it in a few days because we're going to miss 1.27 otherwise. |
|
@kugel- I have not completely reviewed and this is a pretty big PR with a lot of stuff (new plugin API, keybindings support, etc) so I'd really rather review it. I'm still waiting for my PR on your fork to be included and for the documentation to be updated as per comments above. Pardon me if you did already, sometimes Github doesn't email me about some kinds of activity on PRs. |
|
Also, I haven't looked why yet, but Github says this won't merge cleanly. Edit: if it's just from the G_LOG_DOMAIN commit from yesterday, don't worry about it, it will be trivial to fix when merging. |
This allows to drop the custom loader and plugin manager and instead
make use of Geany's new proxy plugin feature, where python plugins
are embedded into the standard plugin manager as first class citizen.
Existing plugins continue to run with one exception: The help and configure
methods have been renamed, and in case of configure the samantics have changed
accordingly to Geany's unified configure dialog for all plugins. So existing
scripts that used either show_help() or show_configure() need to to the following:
1) rename show_help() to help()
2a) rename show_configure to configure()
2b) change configure to just return the content widget and remove the creation
of a custom dialog
The plugin script dir is now $geanylibdir/geany, the same as for native plugns.
Geany loooks only there and doesn't make a difference between native and
sub-plugins.
This is required for some APIs, e.g. keybindings, and is made possible trough the proxy plugin conversion, since now Geany actually creates GeanyPlugin instances for Geanypy plugins.
geany.Plugin gains a method to create keybinding groups, which in turn has a method to add key items (losely matching Geany's original API, but heavily simplified).
Older plugins implement just show_configure() that spawns a dialog itself. geanypy now adds a generic per plugin to the unified plugin preferences dialog, to open that legacy dialog.
|
@codebrainz please review. I've been asking you to do so for some months now. btw, I've rebased everything to fix the merge conflict |
I did an initial review in November and was worried about the compatibility break and finally in January you fixed it. I also made a pull request you ignored, and you still haven't indicated whether you've checked to see if the docs need updating. Then you ignored or incorporated my PR commits without attribution and clobbered all the changes I've reviewed thus far by rebasing (which you know I'm strongly opposed to), making me have to start all over. Now you're pleading with me to spend hours of my free time to test and review this change so it can meet some arbitrary deadline (ie. GeanyPy doesn't release, neither in sync with GP nor at all), and it's unclear if it would even be merged downstream in time for that release, and certainly won't have gotten good testing. sigh
FWIW, please don't rebase any PRs on any of my repositories. I know Geany PRs are ok with wiping out the history, but I'm not, it just makes everything harder for everyone just to save a few bytes/noises in the commit log. |
Most importantly is the changed plugin directory.
|
@codebrainz please have another look, I've updated the docs as well now |
|
@kugel- what about kugel-/geany-plugins@0b0f4dc, is it needed here, or only for GP? |
Have to add ~/.config/geany/plugins to Python's path otherwise loading plugins from there fails. Tested with a relatively complex plugin which also ships extra modules in subdirectory: https://github.com/sagarchalise/geanypy-reStructured-preview
|
@codebrainz indeed, I added the respective commit. |
|
@kugel- was this the only thing out-of-sync with downstream? I can't really remember. |
|
Checked the diff, GP has a few more fixes (regarding config.h, some
minor leak, deprecated functions), while geanypy has the logging module.
Here's a complete diff http://pastebin.geany.org/8kxjI/ (expires in a month)
|
This allows to drop the custom loader and plugin manager and instead
make use of Geany's new proxy plugin feature, where python plugins
are embedded into the standard plugin manager as first class citizen.
Existing plugins continue to run with one exception: The help and configure
methods have been renamed, and in case of configure the samantics have changed
accordingly to Geany's unified configure dialog for all plugins. So existing
scripts that used either show_help() or show_configure() need to to the following:
2a) rename show_configure to configure()
2b) change configure to just return the content widget and remove the creation
of a custom dialog
The plugin script dir is now $geanylibdir/geany, the same as for native plugns.
Geany loooks only there and doesn't make a difference between native and
sub-plugins.