def jrpc(signature, describe=True, summary=None, idempotent=False, docs=None):
    if callable(signature):
        raise TypeError(
            u'The ``jrpc`` decorator must be provided with a method signature')

    def decorator(method):
        """
        Adds a ``rpc_method_name`` attribute to methods decorated, giving
        the method json-rpc method name (this is used by ``JSONRPCServiceMeta``
        to register this method as a supported method. This requires a
        ``JSONRPCService`` to register available methods on class creation,
        instead of instantiation. Use ``describe=False`` to hide a method from
        the service description.
        """
        method.rpc_method_name = name_from_signature(signature)
        method.rpc_params = [{'name': p[0], 'type': p[1], 'optional': p[2]} for
            p in params_from_signature(signature)]
        method.describe = describe
        method.return_type = return_type_from_signature(signature)

        # Procedure description (for ``system.describe``).
        method.description = {
            'name': method.rpc_method_name,
            'summary': summary,
            'help': docs,
            'idempotent': idempotent,
            'params': method.rpc_params,
            'return': method.return_type
        }

        @wraps(method)
        def wrapper(*args, **kwargs):
            """
            Returns the value returned by calling the actual method.
            """
            return method(*args, **kwargs)
        return wrapper
    return decorator
Build hooks env.
dataset/ETHPy150Open orokusaki/django-jsonrpc-2-0/jsonrpc/decorators.py/jrpc--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/group.py/LUGroupSetParams.BuildHooksEnv