creating addon system

Adam Tauno Williams awilliam at whitemice.org
Fri May 21 15:43:10 EDT 2010


On Fri, 2010-05-21 at 08:50 -0700, timo verbeek wrote:
> What is the easiest way in python to create a addon system?
> I found to easy ways:
> * using a import system like this:
>        for striper in stripers:
>         if striper["enabled"]:
>             exec("from strip import %s as _x"%striper["striper"])
>             string = _x.start(string)

This is how I chose to do it.  Just walking a list of bundles and
discover the available classes [as plugins].

<http://coils.hg.sourceforge.net/hgweb/coils/coils/file/b3538e9fafb9/src/coils/core/bundlemanager.py>

-- 
Adam Tauno Williams <awilliam at whitemice.org> LPIC-1, Novell CLA
<http://www.whitemiceconsulting.com>
OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba




More information about the Python-list mailing list