##// END OF EJS Templates
Inputsplitter flushes transformers before retrieving source.
Thomas Kluyver -
Show More
@@ -524,15 +524,31 b' class IPythonInputSplitter(InputSplitter):'
524 self._buffer_raw[:] = []
524 self._buffer_raw[:] = []
525 self.source_raw = ''
525 self.source_raw = ''
526 self.transformer_accumulating = False
526 self.transformer_accumulating = False
527 for t in self.transforms:
528 t.reset()
529
530 def flush_transformers(self):
531 out = None
532 for t in self.transforms:
533 tmp = t.reset()
534 if tmp:
535 out = tmp
536 if out:
537 self._store(out)
527
538
528 def source_raw_reset(self):
539 def source_raw_reset(self):
529 """Return input and raw source and perform a full reset.
540 """Return input and raw source and perform a full reset.
530 """
541 """
542 self.flush_transformers()
531 out = self.source
543 out = self.source
532 out_r = self.source_raw
544 out_r = self.source_raw
533 self.reset()
545 self.reset()
534 return out, out_r
546 return out, out_r
535
547
548 def source_reset(self):
549 self.flush_transformers()
550 return super(IPythonInputSplitter, self).source_reset()
551
536 def push_accepts_more(self):
552 def push_accepts_more(self):
537 if self.transformer_accumulating:
553 if self.transformer_accumulating:
538 return True
554 return True
@@ -66,7 +66,7 b' class CoroutineInputTransformer(InputTransformer):'
66 return self.coro.send(line)
66 return self.coro.send(line)
67
67
68 def reset(self):
68 def reset(self):
69 self.coro.send(None)
69 return self.coro.send(None)
70
70
71
71
72 # Utilities
72 # Utilities
General Comments 0
You need to be logged in to leave comments. Login now