From 31671e8df913d328f713e7176b356455f49b273d 2012-06-12 03:37:04 From: Fernando Perez Date: 2012-06-12 03:37:04 Subject: [PATCH] Add a transform_cell convenience method to the inputsplitter object. --- diff --git a/IPython/core/inputsplitter.py b/IPython/core/inputsplitter.py index 1b3fa02..c43014f 100644 --- a/IPython/core/inputsplitter.py +++ b/IPython/core/inputsplitter.py @@ -809,6 +809,13 @@ class IPythonInputSplitter(InputSplitter): self._is_complete = last_blank(last_block) and lines.isspace() return self._is_complete + def transform_cell(self, cell): + """Process and translate a cell of input. + """ + self.reset() + self.push(cell) + return self.source_reset() + def push(self, lines): """Push one or more lines of IPython input.