code: 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 f 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
docs: Call all functions registered with `addHook` for the given hookname.