server.py 文件源码

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

项目:wslink 作者: Kitware 项目源码 文件源码
def handle_complex_resource_path(path, root, resource):
    # Handle complex endpoint. Twisted expects byte-type URIs.
    fullpath = path.encode('utf-8').split(b'/')
    parent_path_item_resource = root
    for path_item in fullpath:
        if path_item == fullpath[-1]:
            parent_path_item_resource.putChild(path_item, resource)
        else:
            new_resource = Resource()
            parent_path_item_resource.putChild(path_item, new_resource)
            parent_path_item_resource = new_resource


# =============================================================================
# Start webserver
# =============================================================================
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号