1 from manifold.util.log import Log
3 class PluginFactory(type):
4 def __init__(cls, name, bases, dic):
5 #super(PluginFactory, cls).__init__(name, bases, dic)
6 type.__init__(cls, name, bases, dic)
9 registry = getattr(cls, 'registry')
10 except AttributeError:
11 setattr(cls, 'registry', {})
12 registry = getattr(cls, 'registry')
15 if name.endswith('Gateway'):
21 return registry[name.lower()]
23 # Adding a class method get to retrieve plugins by name
24 setattr(cls, 'get', classmethod(get))