##// END OF EJS Templates
Avoid trying to compile the code after each line
Thomas Kluyver -
Show More
@@ -699,18 +699,32 b' class IPythonInputSplitter(InputSplitter):'
699 699 # flush the buffer.
700 700 self._store(lines, self._buffer_raw, 'source_raw')
701 701
702 transformed_lines_list = []
702 703 for line in lines_list:
703 out = self.push_line(line)
704 transformed = self._transform_line(line)
705 if transformed is not None:
706 transformed_lines_list.append(transformed)
704 707
705 return out
708 if transformed_lines_list:
709 transformed_lines = '\n'.join(transformed_lines_list)
710 return super(IPythonInputSplitter, self).push(transformed_lines)
711 else:
712 # Got nothing back from transformers - they must be waiting for
713 # more input.
714 return False
715
716 def _transform_line(self, line):
717 """Push a line of input code through the various transformers.
706 718
707 def push_line(self, line):
708 buf = self._buffer
719 Returns any output from the transformers, or None if a transformer
720 is accumulating lines.
709 721
722 Sets self.transformer_accumulating as a side effect.
723 """
710 724 def _accumulating(dbg):
711 725 #print(dbg)
712 726 self.transformer_accumulating = True
713 return False
727 return None
714 728
715 729 for transformer in self.physical_line_transforms:
716 730 line = transformer.push(line)
@@ -741,4 +755,5 b' class IPythonInputSplitter(InputSplitter):'
741 755
742 756 #print("transformers clear") #debug
743 757 self.transformer_accumulating = False
744 return super(IPythonInputSplitter, self).push(line)
758 return line
759
General Comments 0
You need to be logged in to leave comments. Login now