Commit e5aa09cf authored by Ontje Lünsdorf's avatar Ontje Lünsdorf
Browse files

Added the trigger method to events.

parent 442b8927
......@@ -156,6 +156,16 @@ class Event(object):
raise RuntimeError('Value of %s is not yet available' % self)
return self._value
def trigger(self, event):
"""Triggers the event with value of the provided ``event``.
This method can be used directly as a callback function.
"""
self.ok = event.ok
self._value = event._value
self.env.schedule(self, DEFAULT_PRIORITY)
def succeed(self, value=None):
"""Schedule the event and mark it as successful.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment