def __call__(self, *args, **kwargs):
if self.nc_match:
# Prevent malformed match functions from derailing the entire
# notification process
try:
match = self.nc_match(*args, **kwargs)
except:
print >>sys.stderr, 'Exception in match function for notification %s:' % (repr(self.nc_func),)
traceback.print_exception(*sys.exc_info())
# Treat an exception in the function as a negative response
match = False
if not match:
return None
return self.nc_func(*args, **kwargs)
评论列表
文章目录