MCPcopy
hub / github.com/kovidgoyal/kitty / consume

Method consume

kitty_tests/dnd.py:340–343  ·  view source on GitHub ↗

Return and clear all buffered data for *window_id*.

(self, window_id: int = 0)

Source from the content-addressed store, hash-verified

338 self._buf[window_id] += data
339
340 def consume(self, window_id: int = 0) -> bytes:
341 """Return and clear all buffered data for *window_id*."""
342 buf = self._buf.pop(window_id or self.window_id, bytearray())
343 return bytes(buf)
344
345 def peek(self, window_id: int = 0) -> bytes:
346 return bytes(self._buf.get(window_id or self.window_id, bytearray()))

Calls 1

popMethod · 0.80