示例#1
0
文件: comm.py 项目: Cheng--Li/disco
def upload(urls, source, token=None, **kwargs):
    data = FileSource(source).read()
    headers = auth_header(token)
    if nocurl:
        return [request('PUT', url, data=data, headers=headers).read()
                for url in urls]
    return list(comm_pycurl.upload(urls, data, token, **kwargs))
示例#2
0
def upload(urls, source, token=None, **kwargs):
    source = FileSource(source)
    if nocurl:
        return [
            request('PUT', url, data=source.read(),
                    headers=auth_header(token)).read() for url in urls
        ]
    return list(comm_pycurl.upload(urls, source, token, **kwargs))
示例#3
0
文件: comm.py 项目: christofd/disco
def upload(urls, source, **kwargs):
    source = FileSource(source)
    if nocurl:
        return [request('PUT', url, data=source.read()).read() for url in urls]
    return list(comm_pycurl.upload(urls, source, **kwargs))
示例#4
0
文件: comm.py 项目: JensRantil/disco
def upload(urls, source, token=None, **kwargs):
    source = FileSource(source)
    if nocurl:
        return [request("PUT", url, data=source.read(), headers=auth_header(token)).read() for url in urls]
    return list(comm_pycurl.upload(urls, source, token, **kwargs))