(name)
return decorate
Make a decoractor to register a system action function

    See `do_system_action` docs for expected function signature.

    System actions should be submitted with `system_action.submit(...)`.
    See `submit_system_action` docs for more details.

    :param name: A unique name to be encoded in system action forms and
    used to map them to the corresponding function when the form is
    processed. Once assigned, a system action's name cannot be changed
    without breaking all existing system action forms with that name.
    :returns: A decorator that registers its function as a system action.
Make a decoractor to register a system action function
Make a decoractor to register a system action function
def system_action(name):
    """Make a decoractor to register a system action function

    See `do_system_action` docs for expected function signature.

    System actions should be submitted with `system_action.submit(...)`.
    See `submit_system_action` docs for more details.

    :param name: A unique name to be encoded in system action forms and
    used to map them to the corresponding function when the form is
    processed. Once assigned, a system action's name cannot be changed
    without breaking all existing system action forms with that name.
    :returns: A decorator that registers its function as a system action.
    """
    def decorate(func):
        if name in _actions:
            msg = "system action %r already registered (%r)"
            raise ValueError(msg % (name, _actions[name]))
        _actions[name] = func
        return func

    return decorate
def system_action ( name ) : def decorate ( func ) : if name in _actions : msg = "system action %r already registered (%r)" raise ValueError ( msg % ( name , _actions [ name ] ) ) _actions [ name ] = func return func return decorate