environment/lib/python2.7/site-packages/IPython/frontend/qt/console/ansi_code_processor.py
def set_csi_code(self, command, params=[]):
        """ Set attributes based on CSI (Control Sequence Introducer) code.

        Parameters
        ----------
        command : str
            The code identifier, i.e. the final character in the sequence.

        params : sequence of integers, optional
            The parameter codes for the command.
        """
        if command == 'm':   # SGR - Select Graphic Rendition
            if params:
                self.set_sgr_code(params)
            else:
                self.set_sgr_code([0])

        elif (command == 'J' or # ED - Erase Data
              command == 'K'):  # EL - Erase in Line
            code = params[0] if params else 0
            if 0 <= code <= 2:
                area = 'screen' if command == 'J' else 'line'
                if code == 0:
                    erase_to = 'end'
                elif code == 1:
                    erase_to = 'start'
                elif code == 2:
                    erase_to = 'all'
                self.actions.append(EraseAction('erase', area, erase_to))

        elif (command == 'S' or # SU - Scroll Up
              command == 'T'):  # SD - Scroll Down
            dir = 'up' if command == 'S' else 'down'
            count = params[0] if params else 1
            self.actions.append(ScrollAction('scroll', dir, 'line', count))
def set_csi_code(self, command, params=[]):
        """ Set attributes based on CSI (Control Sequence Introducer) code.

        Parameters
        ----------
        command : str
            The code identifier, i.e. the final character in the sequence.

        params : sequence of integers, optional
            The parameter codes for the command.
        """
        if command == 'm':   # SGR - Select Graphic Rendition
            if params:
                self.set_sgr_code(params)
            else:
                self.set_sgr_code([0])

        elif (command == 'J' or # ED - Erase Data
              command == 'K'):  # EL - Erase in Line
            code = params[0] if params else 0
            if 0 <= code <= 2:
                area = 'screen' if command == 'J' else 'line'
                if code == 0:
                    erase_to = 'end'
                elif code == 1:
                    erase_to = 'start'
                elif code == 2:
                    erase_to = 'all'
                self.actions.append(EraseAction('erase', area, erase_to))

        elif (command == 'S' or # SU - Scroll Up
              command == 'T'):  # SD - Scroll Down
            dir = 'up' if command == 'S' else 'down'
            count = params[0] if params else 1
            self.actions.append(ScrollAction('scroll', dir, 'line', count))
def set_csi_code ( self , command , params = [ ] ) : if command == 'm' : # SGR - Select Graphic Rendition if params : self . set_sgr_code ( params ) else : self . set_sgr_code ( [ 0 ] ) elif ( command == 'J' or # ED - Erase Data command == 'K' ) : # EL - Erase in Line code = params [ 0 ] if params else 0 if 0 <= code <= 2 : area = 'screen' if command == 'J' else 'line' if code == 0 : erase_to = 'end' elif code == 1 : erase_to = 'start' elif code == 2 : erase_to = 'all' self . actions . append ( EraseAction ( 'erase' , area , erase_to ) ) elif ( command == 'S' or # SU - Scroll Up command == 'T' ) : # SD - Scroll Down dir = 'up' if command == 'S' else 'down' count = params [ 0 ] if params else 1 self . actions . append ( ScrollAction ( 'scroll' , dir , 'line' , count ) )
Set attributes based on CSI (Control Sequence Introducer) code.

        Parameters
        ----------
        command : str
            The code identifier, i.e. the final character in the sequence.

        params : sequence of integers, optional
            The parameter codes for the command.
Set attributes based on CSI ( Control Sequence Introducer ) code .