environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ipython_widget.py
def _show_interpreter_prompt_for_reply(self, msg):
        """ Reimplemented for IPython-style prompts.
        """
        # Update the old prompt number if necessary.
        content = msg['content']
        # abort replies do not have any keys:
        if content['status'] == 'aborted':
            if self._previous_prompt_obj:
                previous_prompt_number = self._previous_prompt_obj.number
            else:
                previous_prompt_number = 0
        else:
            previous_prompt_number = content['execution_count']
        if self._previous_prompt_obj and \
                self._previous_prompt_obj.number != previous_prompt_number:
            block = self._previous_prompt_obj.block

            # Make sure the prompt block has not been erased.
            if block.isValid() and block.text():

                # Remove the old prompt and insert a new prompt.
                cursor = QtGui.QTextCursor(block)
                cursor.movePosition(QtGui.QTextCursor.Right,
                                    QtGui.QTextCursor.KeepAnchor,
                                    self._previous_prompt_obj.length)
                prompt = self._make_in_prompt(previous_prompt_number)
                self._prompt = self._insert_html_fetching_plain_text(
                    cursor, prompt)

                # When the HTML is inserted, Qt blows away the syntax
                # highlighting for the line, so we need to rehighlight it.
                self._highlighter.rehighlightBlock(cursor.block())

            self._previous_prompt_obj = None

        # Show a new prompt with the kernel's estimated prompt number.
        self._show_interpreter_prompt(previous_prompt_number + 1)
def _show_interpreter_prompt_for_reply(self, msg):
        """ Reimplemented for IPython-style prompts.
        """
        # Update the old prompt number if necessary.
        content = msg['content']
        # abort replies do not have any keys:
        if content['status'] == 'aborted':
            if self._previous_prompt_obj:
                previous_prompt_number = self._previous_prompt_obj.number
            else:
                previous_prompt_number = 0
        else:
            previous_prompt_number = content['execution_count']
        if self._previous_prompt_obj and \
                self._previous_prompt_obj.number != previous_prompt_number:
            block = self._previous_prompt_obj.block

            # Make sure the prompt block has not been erased.
            if block.isValid() and block.text():

                # Remove the old prompt and insert a new prompt.
                cursor = QtGui.QTextCursor(block)
                cursor.movePosition(QtGui.QTextCursor.Right,
                                    QtGui.QTextCursor.KeepAnchor,
                                    self._previous_prompt_obj.length)
                prompt = self._make_in_prompt(previous_prompt_number)
                self._prompt = self._insert_html_fetching_plain_text(
                    cursor, prompt)

                # When the HTML is inserted, Qt blows away the syntax
                # highlighting for the line, so we need to rehighlight it.
                self._highlighter.rehighlightBlock(cursor.block())

            self._previous_prompt_obj = None

        # Show a new prompt with the kernel's estimated prompt number.
        self._show_interpreter_prompt(previous_prompt_number + 1)
def _show_interpreter_prompt_for_reply ( self , msg ) : # Update the old prompt number if necessary. content = msg [ 'content' ] # abort replies do not have any keys: if content [ 'status' ] == 'aborted' : if self . _previous_prompt_obj : previous_prompt_number = self . _previous_prompt_obj . number else : previous_prompt_number = 0 else : previous_prompt_number = content [ 'execution_count' ] if self . _previous_prompt_obj and self . _previous_prompt_obj . number != previous_prompt_number : block = self . _previous_prompt_obj . block # Make sure the prompt block has not been erased. if block . isValid ( ) and block . text ( ) : # Remove the old prompt and insert a new prompt. cursor = QtGui . QTextCursor ( block ) cursor . movePosition ( QtGui . QTextCursor . Right , QtGui . QTextCursor . KeepAnchor , self . _previous_prompt_obj . length ) prompt = self . _make_in_prompt ( previous_prompt_number ) self . _prompt = self . _insert_html_fetching_plain_text ( cursor , prompt ) # When the HTML is inserted, Qt blows away the syntax # highlighting for the line, so we need to rehighlight it. self . _highlighter . rehighlightBlock ( cursor . block ( ) ) self . _previous_prompt_obj = None # Show a new prompt with the kernel's estimated prompt number. self . _show_interpreter_prompt ( previous_prompt_number + 1 )
Reimplemented for IPython-style prompts.
Reimplemented for IPython - style prompts .