MCPcopy
hub / github.com/httpie/cli / write_stream

Function write_stream

httpie/output/writer.py:61–76  ·  view source on GitHub ↗

Write the output stream.

(
    stream: BaseStream,
    outfile: Union[IO, TextIO],
    flush: bool
)

Source from the content-addressed store, hash-verified

59
60
61def write_stream(
62 stream: BaseStream,
63 outfile: Union[IO, TextIO],
64 flush: bool
65):
66 """Write the output stream."""
67 try:
68 # Writing bytes so we use the buffer interface.
69 buf = outfile.buffer
70 except AttributeError:
71 buf = outfile
72
73 for chunk in stream:
74 buf.write(chunk)
75 if flush:
76 outfile.flush()
77
78
79def write_stream_with_colors_win(

Callers 2

programFunction · 0.85
write_messageFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected