##// END OF EJS Templates
only reset the transform once...
MinRK -
Show More
@@ -495,32 +495,24 b' class IPythonInputSplitter(InputSplitter):'
495 495 pass
496 496
497 497 def flush_transformers(self):
498 def _flush(transform, out):
498 def _flush(transform, outs):
499 499 """yield transformed lines
500 500
501 501 always strings, never None
502 502
503 503 transform: the current transform
504 out: an iterable of previously transformed inputs.
504 outs: an iterable of previously transformed inputs.
505 505 Each may be multiline, which will be passed
506 506 one line at a time to transform.
507 507 """
508 anything = False
509 for out in out:
510 anything = True
511 tmp = None
508 for out in outs:
512 509 for line in out.splitlines():
513 510 # push one line at a time
514 511 tmp = transform.push(line)
515 512 if tmp is not None:
516 513 yield tmp
517 if tmp is None:
518 # transformer is still consuming, reset
519 tmp = transform.reset()
520 if tmp is not None:
521 yield tmp
522 if not anything:
523 # nothing was pushed, reset
514
515 # reset the transform
524 516 tmp = transform.reset()
525 517 if tmp is not None:
526 518 yield tmp
General Comments 0
You need to be logged in to leave comments. Login now