def decorator(function): function = PluginFunction(function) for cmd in cmds: function.add_cmd(cmd) return function