def pass_context(f):
    """Marks a callback as wanting to receive the current context
    object as first argument.
    """
    def new_func(*args, **kwargs):
        return f(get_current_context(), *args, **kwargs)
    return update_wrapper(new_func, f)