MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / write

Method write

pager_lib/tqdm/contrib/__init__.py:23–32  ·  view source on GitHub ↗
(self, x, nolock=False)

Source from the content-addressed store, hash-verified

21 self._buf = []
22
23 def write(self, x, nolock=False):
24 nl = b"\n" if isinstance(x, bytes) else "\n"
25 pre, sep, post = x.rpartition(nl)
26 if sep:
27 blank = type(nl)()
28 tqdm.write(blank.join(self._buf + [pre, sep]),
29 end=blank, file=self._wrapped, nolock=nolock)
30 self._buf = [post]
31 else:
32 self._buf.append(x)
33
34 def __del__(self):
35 if self._buf:

Callers 1

__del__Method · 0.45

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected