move the pump mechanism, allowing the old output code to be removed

This commit is contained in:
Jakob Ketterl
2021-09-20 15:09:26 +02:00
parent 4b36aca6fc
commit 9efe41a2b1
6 changed files with 29 additions and 81 deletions

View File

@ -145,23 +145,3 @@ class Chain(Module):
return self.workers[-1].getOutputFormat()
else:
raise BufferError("getOutputFormat on empty chain")
def pump(self, write):
if self.writer is None:
self.setWriter(Buffer(self.getOutputFormat()))
self.clientReader = self.writer.getReader()
def copy():
run = True
while run:
data = None
try:
data = self.clientReader.read()
except ValueError:
pass
if data is None:
run = False
else:
write(data)
return copy