'stream()
Receive data until the tube exits, and print it to stdout.
Similar to :func:`interactive`, except that no input is sent.
Similar to ``print tube.recvall()`` except that data is printed
as it is received, rather than after all data is received.
Arguments:
line_mode(bool): Whether to receive line-by-line or raw data.
Returns:
All data printed.'

def stream(self, line_mode=True):

    buf = Buffer()
    function = (self.recvline if line_mode else self.recv)
    try:
        while True:
            buf.add(function())
            sys.stdout.write(buf.data[(-1)])
    except KeyboardInterrupt:
        pass
    except EOFError:
        pass
    return buf.get()
