Example #1
0
    def execute(self, factory, configContext=None, **kw):
        value = behavior.bind(default=_marker).get(factory)
        if value is _marker:
            return False

        name, iface, relation, schema, type, t, d, info = value

        registry.registerBehavior(
            name, iface, factory(), 
            relation, schema, type, t, d, configContext, info)
        return True
Example #2
0
    def execute(self, klass, configContext=None, **kw):
        value = behavior.bind(default=_marker).get(klass)
        if value is _marker:
            return False

        name, iface, relation, schema, type, t, d, info = value

        if iface is None:
            iface = list(interface.implementedBy(klass))[0]

        registry.registerBehavior(
            name, iface, klass, 
            relation, schema, type, t, d, configContext, info)
        return True