I think the decorator is the best way to expose a method to CherryPy, but you can also expose a method by setting its exposed member to true.
我认为装饰符是将方法暴露给CherryPy的最佳方式,但是也可以通过将其成员exposed设置为True来暴露一个方法。
However, in other cases, the decorator might combine the undecorated method behavior with some new capabilities.
然而,在其他情况下,decorator可能会将未修饰的方法与一些新功能相结合。
In the filesystem class, you added a transactional method that you will use a decorator to handle the semantics of the commits to the database for filesystem events.
在Filesyste m类中,您添加了一个transactional方法,您将使用一个修饰类来处理将文件系统事件提交给数据库的语义。
应用推荐