Ejemplo n.º 1
0
    def test_subscriber_object(self):
        from zope.interface.interfaces import IObjectEvent, ObjectEvent

        events = []

        @config.subscriber(IContext, IObjectEvent)
        def testSubscriber(*args):
            events.append(args)

        self._init_ptah()

        sm = self.config.registry
        sm.subscribers((ObjectEvent(Context(IContext)),), None)

        self.assertTrue(len(events) == 1)
        self.assertTrue(len(events[0]) == 2)
Ejemplo n.º 2
0
 def __init__(self, ob, request):
     ObjectEvent.__init__(self, ob)
     self.request = request
Ejemplo n.º 3
0
 def __init__(self, object, oldParent, oldName, newParent, newName):
     ObjectEvent.__init__(self, object)
     self.oldParent = oldParent
     self.oldName = oldName
     self.newParent = newParent
     self.newName = newName
 def __init__(self, object, workflow, action):
     ObjectEvent.__init__(self, object)
     self.workflow = workflow
     self.action = action
Ejemplo n.º 5
0
 def __init__(self, object, oldParent, oldName, newParent, newName):
     ObjectEvent.__init__(self, object)
     self.oldParent = oldParent
     self.oldName = oldName
     self.newParent = newParent
     self.newName = newName
Ejemplo n.º 6
0
 def __init__(self, object, oldParent, oldName):
     ObjectEvent.__init__(self, object)
     self.oldParent = oldParent
     self.oldName = oldName
Ejemplo n.º 7
0
 def __init__(self, object, newParent=None, newName=None):
     ObjectEvent.__init__(self, object)
     if newParent is None:
         newParent = getattr(object, "__parent__", None)
     if newName is None:
         newName = getattr(object, "__name__", None)
Ejemplo n.º 8
0
 def __init__(self, it, external_value=None, root=None):
     ObjectEvent.__init__(self, it)
     self.external_value = external_value
     self.root = root
Ejemplo n.º 9
0
 def __init__(self, ob, request):
     ObjectEvent.__init__(self, ob)
     self.request = request
Ejemplo n.º 10
0
 def __init__(self, object, workflow, action):
     ObjectEvent.__init__(self, object)
     self.workflow = workflow
     self.action = action