resolvers.py 文件源码

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

项目:vspheretools 作者: devopshq 项目源码 文件源码
def Opaque(uri, tc, ps, **keywords):
    '''Resolve a URI and return its content as a string.
    '''
    source = urllib.urlopen(uri, **keywords)
    enc = source.info().getencoding()
    if enc in ['7bit', '8bit', 'binary']: return source.read()

    data = StringIO.StringIO()
    mimetools.decode(source, data, enc)
    return data.getvalue()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号