environment/lib/python2.7/site-packages/IPython/frontend/qt/console/console_widget.py
def _append_custom(self, insert, input, before_prompt=False):
        """ A low-level method for appending content to the end of the buffer.

        If 'before_prompt' is enabled, the content will be inserted before the
        current prompt, if there is one.
        """
        # Determine where to insert the content.
        cursor = self._control.textCursor()
        if before_prompt and (self._reading or not self._executing):
            cursor.setPosition(self._append_before_prompt_pos)
        else:
            cursor.movePosition(QtGui.QTextCursor.End)
        start_pos = cursor.position()

        # Perform the insertion.
        result = insert(cursor, input)

        # Adjust the prompt position if we have inserted before it. This is safe
        # because buffer truncation is disabled when not executing.
        if before_prompt and not self._executing:
            diff = cursor.position() - start_pos
            self._append_before_prompt_pos += diff
            self._prompt_pos += diff

        return result
def _append_custom(self, insert, input, before_prompt=False):
        """ A low-level method for appending content to the end of the buffer.

        If 'before_prompt' is enabled, the content will be inserted before the
        current prompt, if there is one.
        """
        # Determine where to insert the content.
        cursor = self._control.textCursor()
        if before_prompt and (self._reading or not self._executing):
            cursor.setPosition(self._append_before_prompt_pos)
        else:
            cursor.movePosition(QtGui.QTextCursor.End)
        start_pos = cursor.position()

        # Perform the insertion.
        result = insert(cursor, input)

        # Adjust the prompt position if we have inserted before it. This is safe
        # because buffer truncation is disabled when not executing.
        if before_prompt and not self._executing:
            diff = cursor.position() - start_pos
            self._append_before_prompt_pos += diff
            self._prompt_pos += diff

        return result
A low-level method for appending content to the end of the buffer.

        If 'before_prompt' is enabled, the content will be inserted before the
        current prompt, if there is one.