Stuff
public python v1 · immutableregistry = {}def registerPlugin(name, plugin): registry[name] = pluginclass IPlugin(zope.interface): def doStuff(): """ does stuff """class PluginA(object): implements(IPlugin) def doStuff(self): print str(self), "is doing stuff"class PluginB(PluginA): implements(IPlugin) print str(self), "is doing stuff"registerPlugin("A", PluginA())registerPlugin("B", PluginB())registry["A"].doStuff()registry["B"].doStuff()