'Properly register a hook.'

def register_hook(self, event, hook):

    if callable(hook):
        self.hooks[event].append(hook)
    elif hasattr(hook, '__iter__'):
        self.hooks[event].extend((h for h in hook if callable(h)))
