MCPcopy
hub / github.com/amoffat/sh / read

Method read

src/sh/__init__.py:3232–3246  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3230 self.pipe_queue().put(chunk)
3231
3232 def read(self):
3233 # if we're PY3, we're reading bytes, otherwise we're reading
3234 # str
3235 try:
3236 chunk = no_interrupt(os.read, self.stream, self.bufsize)
3237 except OSError as e:
3238 self.log.debug("got errno %d, done reading", e.errno)
3239 return True
3240 if not chunk:
3241 self.log.debug("got no chunk, done reading")
3242 return True
3243
3244 self.log.debug("got chunk size %d: %r", len(chunk), chunk[:30])
3245 for chunk in self.stream_bufferer.process(chunk):
3246 self.write_chunk(chunk)
3247
3248
3249class StreamBufferer:

Callers 14

__init__Method · 0.80
output_threadFunction · 0.80
fnFunction · 0.80
test_pipe_fdMethod · 0.80
test_out_redirectionMethod · 0.80
test_err_redirectionMethod · 0.80
test_tty_teeMethod · 0.80
test_stdout_pipeMethod · 0.80
test_out_filenameMethod · 0.80

Calls 4

write_chunkMethod · 0.95
no_interruptFunction · 0.85
debugMethod · 0.80
processMethod · 0.80

Tested by 11

test_pipe_fdMethod · 0.64
test_out_redirectionMethod · 0.64
test_err_redirectionMethod · 0.64
test_tty_teeMethod · 0.64
test_stdout_pipeMethod · 0.64
test_out_filenameMethod · 0.64
test_out_pathlikeMethod · 0.64
test_append_stdoutMethod · 0.64