def callHook(self, hookname, *args, **kwargs):
        'Call all functions registered with `addHook` for the given hookname.'
        r = []
        for f in self.hooks[hookname]:
            try:
                r.append(f(*args, **kwargs))
            except Exception as e:
                exceptionCaught(e)
        return r
def callHook ( self , hookname , * args , ** kwargs ) : r = [ ] for f in self . hooks [ hookname ] : try : r . append ( f ( * args , ** kwargs ) ) except Exception as e : exceptionCaught ( e ) return r
Call all functions registered with `addHook` for the given hookname.