Fwd: [Gazpacho] Plugin system proposal

Mattias Karlsson enkidude at gmail.com
Tue Jun 6 13:10:09 CEST 2006


Forgot to send the mail to the gazpacho-list.

---------- Forwarded message ----------
From: Mattias Karlsson <enkidude at gmail.com>
Date: Jun 6, 2006 12:40 PM
Subject: Re: [Gazpacho] Plugin system proposal
To: Lorenzo Gil Sanchez <lgs at sicem.biz>



On 6/6/06, Lorenzo Gil Sanchez <lgs at sicem.biz> wrote:
>
> El lun, 05-06-2006 a las 19:14 -0300, Johan Dahlin escribió:


> > * A plugin.py file where a subclass of gazpacho.plugin.Plugin should
> > >   be defined. The name of this class should be the same as the string
> > >   'plugin_class' found in the __init__.py file
> >
> > just use namedAny to fetch the python object, it can then be a package
> or
> > a module.
>
> Are you suggesting to depend on Twisted or is that function in the
> standard Python library?


There is a namedAny in kiwi.python.


> >
> > > Plugin base class (gazpacho.plugin.Plugin)
> >
> > > class GazpachoPlugin(object):
> > >
> > >   def get_ui(self):
> > >     """Returns the UI string for this plugin"""
> > >
> > >   def get_actions(self):
> > >     """Returns a list of actions that match the UI string
> definition"""
> > >
> > >   def on_object_selected(self):
> > >     """This will be called every time an object/widget is selected"""
> > >
> > >   def on_project_changed(self):
> > >     """This will be called when a project is opened or selected"""
> >
> > You don't need any of these, instead pass in the application object and
> let
> > the plugin developer fetch projects/selections/whatever themselves.
> > They would also be responsible for merging/removing actions and xml from
> the
> >  ui manager. Leave as much freedom to the plugin writers as possible.
> >
>
> I like the GEdit plugin API. It just have 3 important methods:
>
> - Activate
>
> - Deactivate
>
> - Get Configuration Dialog


This sounds good to me. I guess we can skip the last one for now, though.
Maybe we should create a SimplePlugin base class with methods similar to
what you suggested earlier. Just to make it easier to write simple plugins
(if we can find some use cases that would benefit from this, that is).

/ Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://sicem.biz/pipermail/gazpacho/attachments/20060606/33cd0031/attachment.html


More information about the Gazpacho mailing list