Exemple #1
0
async def multiplexed_result(response, follow=False, is_tty=False, encoding="utf-8"):

    # if is_tty is True you get a raw output
    log_stream = MultiplexedResult(response, raw=is_tty)

    if follow:
        return _DecodeHelper(log_stream, encoding=encoding)
    else:
        d = []
        async for piece in _DecodeHelper(log_stream, encoding=encoding):
            d.append(piece)
        return d
Exemple #2
0
async def multiplexed_result(response, follow=False, is_tty=False, encoding="utf-8"):

    # if is_tty is True you get a raw output
    log_stream = MultiplexedResult(response, raw=is_tty)

    if follow:
        return _DecodeHelper(log_stream, encoding=encoding)
    else:
        d = []
        async for piece in _DecodeHelper(log_stream, encoding=encoding):
            d.append(piece)
        return d
Exemple #3
0
async def multiplexed_result_stream(response, is_tty=False, encoding="utf-8"):

    # if is_tty is True you get a raw output
    log_stream = MultiplexedResult(response, raw=is_tty)

    async for item in _DecodeHelper(log_stream, encoding=encoding):
        yield item
Exemple #4
0
async def multiplexed_result(response,
                             follow=False,
                             is_tty=False,
                             encoding='utf-8'):

    log_stream = MultiplexedResult(response, raw=False)
    if is_tty:
        log_stream = MultiplexedResult(response, raw=True)

    if follow:
        return _DecodeHelper(log_stream, encoding=encoding)
    else:
        d = []
        async for piece in _DecodeHelper(log_stream, encoding=encoding):
            if isinstance(piece, str):
                d.append(piece)
        return ''.join(d)