(self, progress)
Actually fill the progress bars accordingly
Actually fill the progress bars accordingly
Actually fill the progress bars accordingly
def plot(self, progress):
        """
        Actually fill the progress bars accordingly
        """
        if progress < self.prevprogress:
            self.donedrives += 1
        self.prevprogress = progress

        progress = progress + self.donedrives
        totalbar = int((progress/self.drives)*((self.width-2)/2))
        currentbar = int(progress*((self.width-2)/2)) % (self.width/2)

        self.preptotal()
        self.prepcurrent()

        self.totalbar.addstr(1, 1, "-"*(totalbar-2), curses.color_pair(2))
        self.currentbar.addstr(1, 1, "-"*(currentbar-2), curses.color_pair(2))

        self.refresh()
def plot ( self , progress ) : if progress < self . prevprogress : self . donedrives += 1 self . prevprogress = progress progress = progress + self . donedrives totalbar = int ( ( progress / self . drives ) * ( ( self . width - 2 ) / 2 ) ) currentbar = int ( progress * ( ( self . width - 2 ) / 2 ) ) % ( self . width / 2 ) self . preptotal ( ) self . prepcurrent ( ) self . totalbar . addstr ( 1 , 1 , "-" * ( totalbar - 2 ) , curses . color_pair ( 2 ) ) self . currentbar . addstr ( 1 , 1 , "-" * ( currentbar - 2 ) , curses . color_pair ( 2 ) ) self . refresh ( )