(self, row, col, char, attr)
return pop_char
Insert a halfwidth character,
        NOTE: This sets the attribute of *everything that has moved* to attr.
        Return the character dropping off at the end.
Insert a halfwidth character,
        NOTE: This sets the attribute of *everything that has moved* to attr.
        Return the character dropping off at the end.
Insert a halfwidth character NOTE : This sets the attribute of * everything that has moved * to attr . Return the character dropping off at the end .
def insert_char_attr(self, row, col, char, attr):
        """
        Insert a halfwidth character,
        NOTE: This sets the attribute of *everything that has moved* to attr.
        Return the character dropping off at the end.
        """
        therow = self._rows[row-1]
        therow.chars.insert(col-1, char)
        therow.attrs.insert(col-1, attr)
        pop_char = therow.chars.pop()
        pop_attr = therow.attrs.pop()
        if therow.length >= col:
            therow.length = min(therow.length + 1, self._width)
        else:
            therow.length = col
        # reset the attribute of all moved chars
        stop_col = max(therow.length, col)
        therow.attrs[col-1:stop_col] = [attr] * (stop_col - col + 1)
        # attrs change only up to logical end of row but dbcs can change up to row width
        self._update(row, col, stop_col)
        return pop_char
def insert_char_attr ( self , row , col , char , attr ) : therow = self . _rows [ row - 1 ] therow . chars . insert ( col - 1 , char ) therow . attrs . insert ( col - 1 , attr ) pop_char = therow . chars . pop ( ) pop_attr = therow . attrs . pop ( ) if therow . length >= col : therow . length = min ( therow . length + 1 , self . _width ) else : therow . length = col # reset the attribute of all moved chars stop_col = max ( therow . length , col ) therow . attrs [ col - 1 : stop_col ] = [ attr ] * ( stop_col - col + 1 ) # attrs change only up to logical end of row but dbcs can change up to row width self . _update ( row , col , stop_col ) return pop_char