From 7ca5673ddc66790939f01ebb166c0d140666984b Mon Sep 17 00:00:00 2001 From: "Matthew D. Scholefield" Date: Wed, 15 May 2019 02:32:53 -0500 Subject: [PATCH] Add len method to ReadWriteStream --- runner/precise_runner/runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runner/precise_runner/runner.py b/runner/precise_runner/runner.py index 8336096..deaeb1b 100644 --- a/runner/precise_runner/runner.py +++ b/runner/precise_runner/runner.py @@ -83,6 +83,9 @@ class ReadWriteStream(object): self.write_event = Event() self.chop_samples = chop_samples + def __len__(self): + return len(self.buffer) + def read(self, n=-1, timeout=None): if n == -1: n = len(self.buffer)