def setup_hook(hook_type):
    """
    This decorator marks the decorated function to be interested in a certain hook
    """
    def wrap(function):
        """
        Wrapper function
        """
        if not hasattr(function, 'hooks'):
            function.hooks = []
        if isinstance(hook_type, list):
            function.hooks += hook_type
        else:
            function.hooks.append(hook_type)
        return function
    return wrap