Trivial plugin framework?

V

Ville Vainio

Anyone know any good, low-fat, Open Source (BSD or better) trivial
plugin framework that would allow me to put a bunch of .py-files in a
directory, with contents like:

# /tmp/py/mymod.py

class C:
pass

class CFact:
pass

__plugindict__ = {
'somefactory' : CFact
}


And then do

import plugin

# sees that implementation repository doesn't exist, so creates one by
# looking at all the modules. Having seen that 'somefactory' is in
# mymod.py it only execs that.

fact = plugin.get("/tmp/py", 'somefactory')

obj = fact()

?

It seems easy enough to do, in fact I'm implementing one as I speak
(well, not physically possible but anyway ;-), but I figured there has
to be something that fits the bell better than my would-be
implementation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top