plugins

Steve Holden sholden at holdenweb.com
Wed Oct 23 10:47:43 EDT 2002


[posted & mailed]
> > "Joseph N. Ruskiewicz" <jruskiew at andrew.cmu.edu> wrote ...
> > > Hello again everybody,
> > > I have read through most of these postings and I find it quite amazing
> the
> > > community that does exist.  I hope in the future that I will be more
> > > involved in this community.  to the meat of the question:
> > >     I am designing a project and I need some sort of plug-in
> architecture.
> > > I have never done this before.  I think that I may have some basic
ideas
> > > that may work, but again, not quite sure.  so any advice or references
> on
> > > creating a good plug-in architecture would be great.
> > >
> >
> > Well, this isn't as easy as it might sound, because it's a very general
> > question. A bit more background might help.
> >
> > Ultimately you will want to define an API, an application programmer
> > interface, for your plug-ins, so that they can interact correctly with
the
> > framework you intend to plug them in to. A good way to start might be to
> > write the framework and, as you are writing, make notes about the
> > functionality you want for the plug-ins (it may be you already know
this,
> in
> > which case I'm sorry this is at too low a level). If the program
contains
> > plug-in logic for a simple plug-in you can then refactor the code to
> > abstract the functionality behind an object-oriented interface. The
> > interface doesn't have to be OO, but it can be helpful.
> >
> > Ultimately you can build modules containing class definitions for
> different
> > types of plug-in object, then import them dynamically using the
> __import__()
> > function. Once imported you can create instances of the classes defined
in
> > the modules.
> >
> > Does this help at all?
> >
> thanks for the advice.  i think it will have to be something that i work
out
> over time.
> also, a side question?  i have always writen my GUIs by hand.  is using
> glade and pygtk.glade workable for a larger scale project?
>
> joseph
>
>
Well I haven't used glade or pygtk at all, so my advice wouldn't help. You
might also look at Boa Constructor and PythonCard, bot based on wxPython.
The latter is probably better suited to individual dialogs. Both are in
development.

regards
 Stevepytho






More information about the Python-list mailing list