(self, text)
Transform text string into a list of strings, wrapped to fit the
        window size. Sets the dimensions of the text buffer.
Transform text string into a list of strings, wrapped to fit the
        window size. Sets the dimensions of the text buffer.
Transform text string into a list of strings wrapped to fit the window size . Sets the dimensions of the text buffer .
def text_init(self, text):
        """Transform text string into a list of strings, wrapped to fit the
        window size. Sets the dimensions of the text buffer.

        """
        t = str(text).split('\n')
        if self.max_text_size != 1:
            t = [wrap(i, self.win_size_x - 1) for i in t]
        else:
            t = [t]
        self.text = []
        for line in t:
            # This retains any empty lines
            if line:
                self.text.extend(line)
            else:
                self.text.append("")
        if self.text:
            # Sets size for text buffer...may be larger than win_size!
            self.buffer_cols = max(self.win_size_x,
                                   max([len(i) for i in self.text]))
            self.buffer_rows = max(self.win_size_y, len(self.text))
        self.text_orig = self.text[:]
        if self.max_text_size > 1:
            # Truncates initial text if max_text_size < len(self.text)
            self.text = self.text[:self.max_text_size]
        self.buf_length = len(self.text[self.buffer_idx_y])
def text_init ( self , text ) : t = str ( text ) . split ( '\n' ) if self . max_text_size != 1 : t = [ wrap ( i , self . win_size_x - 1 ) for i in t ] else : t = [ t ] self . text = [ ] for line in t : # This retains any empty lines if line : self . text . extend ( line ) else : self . text . append ( "" ) if self . text : # Sets size for text buffer...may be larger than win_size! self . buffer_cols = max ( self . win_size_x , max ( [ len ( i ) for i in self . text ] ) ) self . buffer_rows = max ( self . win_size_y , len ( self . text ) ) self . text_orig = self . text [ : ] if self . max_text_size > 1 : # Truncates initial text if max_text_size < len(self.text) self . text = self . text [ : self . max_text_size ] self . buf_length = len ( self . text [ self . buffer_idx_y ] )