[Geany-devel] multi-plugin plugin - Re: Python plugin API

Nick Treleaven nick.treleaven at xxxxx
Fri Jun 12 11:25:41 UTC 2009


On Fri, 12 Jun 2009 13:06:55 +0200
Jonas Haag <jonas at jonashaag.de> wrote:

> I think additionally to the plugin API there should be some interface 
> API which has more privileges (like registering and running other plugins).
> 
> As this would be probably difficult to implement I propose to add the 
> possibillity to register a plugin as an "interface" (e.g. to another 
> language). Having a Python interface, users could put their *.py-files 
> in the geany plugins directory and geany passes them to that Python 
> interface. There would be several advantages using such system:
> 
>   * Plugins offering APIs to other languages wouldn't have to implement
>     a registration API (or, at least, not the whole stuff)
> *  Geany could register the plugins itself (I dunno wether it's
>     important for the plugin system which plugin did what)
> 
> I thought about something like this: If a *.py (or *.whatever) file in 
> the plugin directories is found, geany passes that file (path) to the 
> according interface plugin, which returns the meta information (like 
> required API version and stuff) to geany. Whenever geany would call a 
> function of that Python plugin, it passes all the information to the 
> interface plugin which acts as a man-in-the-middle (calls the function 
> in the Python plugin and returns the return-values to geany, if there 
> are any).  The same way, Python plugin calls geany API functions: Passes 
> the information to the interface handler, the interface handler acts as 
> man-in-the-middle.

Personally I'd prefer Geany to just do the minimum, have some way of
registering plugin-like objects from within a C plugin.

The way Geany interfaces with C plugins is by looking up symbols in it
by a text string. So if we modified this to also be able to call a
function in the C plugin, perhaps that function could handle looking up
e.g. Python symbols in a script by name.

Regards,
Nick



More information about the Devel mailing list