_cprequest.py 文件源码

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

项目:autosub-bootstrapbill 作者: BenjV 项目源码 文件源码
def hooks_namespace(k, v):
    """Attach bare hooks declared in config."""
    # Use split again to allow multiple hooks for a single
    # hookpoint per path (e.g. "hooks.before_handler.1").
    # Little-known fact you only get from reading source ;)
    hookpoint = k.split('.', 1)[0]
    if isinstance(v, text_or_bytes):
        v = cherrypy.lib.attributes(v)
    if not isinstance(v, Hook):
        v = Hook(v)
    cherrypy.serving.request.hooks[hookpoint].append(v)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号