MCPcopy Create free account
hub / github.com/apple/ml-streambridge / write

Method write

streambridge/utils.py:97–109  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

95 return getattr(self.terminal, attr)
96
97 def write(self, buf):
98 temp_linebuf = self.linebuf + buf
99 self.linebuf = ""
100 for line in temp_linebuf.splitlines(True):
101 # From the io.TextIOWrapper docs:
102 # On output, if newline is None, any '\n' characters written
103 # are translated to the system default line separator.
104 # By default sys.stdout.write() expects '\n' newlines and then
105 # translates them so this is still cross platform.
106 if line[-1] == "\n":
107 self.logger.log(self.log_level, line.rstrip())
108 else:
109 self.linebuf += line
110
111 def flush(self):
112 if self.linebuf != "":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected