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

Geanypy proxy and keybindings #384

Merged
merged 5 commits into from Mar 11, 2016
Merged

Geanypy proxy and keybindings #384

merged 5 commits into from Mar 11, 2016

Conversation

kugel-
Copy link
Member

@kugel- kugel- commented Mar 6, 2016

This is reworked version if #295

I opened a new PR because I don't have incremental commits available (I cherry picked from the upstream PR codebrainz/geanypy#37) and didn't want to destroy the comments there.

Anyway, the commits tell the story. This PR converts geanypy to a proxy plugin (needs Geany git master/1.26), and then adds the long-awaited keybindings support.

With this, python plugins are just like other plugins w.r.t to the PM dialog, configuration and keybindings

According to #295 @codebrainz is fine if G-P merges it first (@codebrainz please speak up if you changed your mind).

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.
Most importantly is the changed plugin directory.
@kugel-
Copy link
Member Author

kugel- commented Mar 6, 2016

@frlan @elextr ping :)

@frlan frlan added this to the 1.27 milestone Mar 6, 2016
@elextr
Copy link
Member

elextr commented Mar 10, 2016

Well, I can't test it and its too big for more than a scan inspection, but it has been beaten up on upstream a bit so I'm ok with it.

BTW has it ever been tested on windows?

@elextr
Copy link
Member

elextr commented Mar 10, 2016

@frlan can't see the official label to add so just saying ok here :)

[Edit: I didn't see any translatable strings so freeze doesn't matter]

@sagarchalise
Copy link
Contributor

@kugel- I have been testing this enhancement in geanypy. It doesnot load plugins in ~/.config/geany/plugins directory. I get ImportError. I have been testing these plugins

https://github.com/sagarchalise/geanypy-emmet
https://github.com/sagarchalise/geanypy-reStructured-preview

@kugel-
Copy link
Member Author

kugel- commented Mar 10, 2016

@sagarchalise it never did that. It thinkpad you have to Do it manually (for extra modules). Or are you saying your main plugins file can't be loaded?

@kugel-
Copy link
Member Author

kugel- commented Mar 11, 2016

@frlan ping

frlan added a commit that referenced this pull request Mar 11, 2016
 Geanypy proxy and keybindings
@frlan frlan merged commit 3ef8910 into geany:master Mar 11, 2016
@codebrainz
Copy link
Member

You guys are crazy merging such a big change so close to release :)

@sagarchalise
Copy link
Contributor

@kugel- My main plugin file is loaded only from /usr/local/lib/geany path but not from config directory.

@kugel-
Copy link
Member Author

kugel- commented Mar 11, 2016 via email

@elextr
Copy link
Member

elextr commented Mar 11, 2016

You guys are crazy merging such a big change so close to release :)

But upstream so totally tested it :)

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.

None yet

5 participants