Ejemplo n.º 1
0
    def factory(self, container, name, factory):
        implemented = factory.getInterfaces()

        for iface in self.types:
            if implemented.isOrExtends(iface):
               return
        raise InvalidItemType(container, factory, self.types)
Ejemplo n.º 2
0
 def __call__(self, container, name, object):
     for iface in self.types:
         if iface.providedBy(object):
             return
     raise InvalidItemType(container, object, self.types)