thermostat.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:thermostat_ita 作者: jpnos26 项目源码 文件源码
def require(*conditions):
    """A decorator that appends conditions to the auth.require config
    variable."""
    def decorate(f):
        if not hasattr(f, '_cp_config'):
            f._cp_config = dict()
        if 'auth.require' not in f._cp_config:
            f._cp_config['auth.require'] = []
        f._cp_config['auth.require'].extend(conditions)
        return f
    return decorate


# Conditions are callables that return True
# if the user fulfills the conditions they define, False otherwise
#
# They can access the current username as cherrypy.request.login
#
# Define those at will however suits the application.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号