(self, line, status, continuing = False)
Log a line to the logging window. Autoscrolls
        A progress of 1.0 will fill the current bar accordingly (useful for 'continue')
        Auto splits and indents long lines
Log a line to the logging window. Autoscrolls
        A progress of 1.0 will fill the current bar accordingly (useful for 'continue')
        Auto splits and indents long lines
Log a line to the logging window . Autoscrolls A progress of 1 . 0 will fill the current bar accordingly ( useful for continue ) Auto splits and indents long lines
def logger(self, line, status, continuing = False):
        """
        Log a line to the logging window. Autoscrolls
        A progress of 1.0 will fill the current bar accordingly (useful for 'continue')
        Auto splits and indents long lines
        """
        statuses = {
            "ERROR": curses.color_pair(1),
            "INFO": curses.color_pair(2)
        }
        if status == "ERROR" and not continuing:
            progress = 1.0
        else:
            progress = self.idx/self.items
        self.idx += 1
        first = True
        while line:
            if first:
                first = False
                self.loglines.append((line[:37], status))
                line = line[37:]
            else:
                self.loglines.append(('  '+line[:35], status))
                line = line[35:]
        self.preplog()
        for idx, line in enumerate(self.loglines[-((self.height/2)-3):]):
            self.log.addstr(idx+1, 1, line[0], statuses[line[1]])
        if progress:
            self.plot(progress)
        self.refresh()
def logger ( self , line , status , continuing = False ) : statuses = { "ERROR" : curses . color_pair ( 1 ) , "INFO" : curses . color_pair ( 2 ) } if status == "ERROR" and not continuing : progress = 1.0 else : progress = self . idx / self . items self . idx += 1 first = True while line : if first : first = False self . loglines . append ( ( line [ : 37 ] , status ) ) line = line [ 37 : ] else : self . loglines . append ( ( '  ' + line [ : 35 ] , status ) ) line = line [ 35 : ] self . preplog ( ) for idx , line in enumerate ( self . loglines [ - ( ( self . height / 2 ) - 3 ) : ] ) : self . log . addstr ( idx + 1 , 1 , line [ 0 ] , statuses [ line [ 1 ] ] ) if progress : self . plot ( progress ) self . refresh ( )