Parent: [ccda7d] (diff)

Child: [d84715] (diff)

Download this file

event_tasks.py    17 lines (13 with data), 410 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
import sys
from allura.lib.decorators import task, event_handler
from allura.lib.exceptions import CompoundError
@task
def event(event_type, *args, **kwargs):
exceptions = []
for t in event_handler.listeners[event_type]:
try:
t(event_type, *args, **kwargs)
except:
exceptions.append(sys.exc_info())
if exceptions:
raise CompoundError(*exceptions)