environ_parsers.py 文件源码

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

项目:web3py 作者: web2py 项目源码 文件源码
def parse_get_vars(environ):
    """Takes the QUERY_STRING and unpacks it to get_vars"""
    # Ref: https://docs.python.org/2/library/cgi.html#cgi.parse_qs
    query_string = environ.get('QUERY_STRING', '')
    dget = urlparse.parse_qs(query_string, keep_blank_values=1)  
    get_vars = Storage(dget)
    for (key, value) in get_vars.iteritems():
        if isinstance(value, list) and len(value) == 1:
            get_vars[key] = value[0]
    return get_vars
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号