(self, line, newline=True)
Print a line from a program listing or EDIT prompt.
Print a line from a program listing or EDIT prompt.
Print a line from a program listing or EDIT prompt .
def list_line(self, line, newline=True):
        """Print a line from a program listing or EDIT prompt."""
        # no wrap if 80-column line, clear row before printing.
        # replace LF CR with LF
        line = line.replace(b'\n\r', b'\n')
        cuts = line.split(b'\n')
        for i, l in enumerate(cuts):
            # clear_line looks back along wraps, use screen.clear_from instead
            self._text_screen.clear_from(self._text_screen.current_row, 1)
            self.write(l)
            if i != len(cuts) - 1:
                self.write(b'\n')
        if newline:
            self.write_line()
        # remove wrap after 80-column program line
        if len(line) == self.width and self._text_screen.current_row > 2:
            self._text_screen.set_wrap(self._text_screen.current_row-2, False)
def list_line ( self , line , newline = True ) : # no wrap if 80-column line, clear row before printing. # replace LF CR with LF line = line . replace ( b'\n\r' , b'\n' ) cuts = line . split ( b'\n' ) for i , l in enumerate ( cuts ) : # clear_line looks back along wraps, use screen.clear_from instead self . _text_screen . clear_from ( self . _text_screen . current_row , 1 ) self . write ( l ) if i != len ( cuts ) - 1 : self . write ( b'\n' ) if newline : self . write_line ( ) # remove wrap after 80-column program line if len ( line ) == self . width and self . _text_screen . current_row > 2 : self . _text_screen . set_wrap ( self . _text_screen . current_row - 2 , False )