将函数传递给Cherrypy中的装饰器

How do I pass the index() to the decorator function called uppercase(). I want the value passed from index() to be capitalized.

我收到此错误:

500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/home/user/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 701, in _do_respond
    self.hooks.run('before_finalize')
  File "/home/user/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 95, in run
    self.run_hooks(iter(sorted(self[point])))
  File "/home/user/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 117, in run_hooks
    hook()
  File "/home/user/.local/lib/python3.6/site-packages/cherrypy/_cprequest.py", line 65, in __call__
    return self.callback(**self.kwargs)
TypeError: uppercase() missing 1 required positional argument: 'func'
import cherrypy
from cherrypy import tools

@cherrypy.tools.register('before_finalize')
def uppercase(func):
    def wrapper():
        original_result = func()
        modified_result = original_result.upper()
        return modified_result
    return wrapper

class HelloWorld(object):
    @cherrypy.expose
    @cherrypy.tools.uppercase()
    def index(self):
        return 'Hello!'


if __name__ == '__main__':
    cherrypy.tools.uppercase = cherrypy.Tool('before_finalize', uppercase)
    cherrypy.quickstart(HelloWorld())