Ejemplo n.º 1
0
 def Increment(self):
     if self.counter == 0:
         self.pb = ProgressBar(self.term, 'pytof')
         self.pb.clear()
     self.counter += 1
     percent = self.counter / float(self.target)
     self.pb.update(percent, '(%d processed out of %d)' \
             % (self.counter, self.target))
Ejemplo n.º 2
0
 def __init__(self, target, output=sys.stdout):
     #raise UnicodeDecodeError
     self.counter = 0
     self.target = target
     self.term = TerminalController()
     if output == sys.stderr:
         logger.info('Do nothing in curses mode')
         return
     self.pb = ProgressBar(self.term, 'pytof')
Ejemplo n.º 3
0
class ProgressMsg(object):
    """ curses progress bar """
    def __init__(self, target, output=sys.stdout):
        #raise UnicodeDecodeError
        self.counter = 0
        self.target = target
        self.term = TerminalController()
        if output == sys.stderr:
            logger.info('Do nothing in curses mode')
            return
        self.pb = ProgressBar(self.term, 'pytof')

    def Increment(self):
        if self.counter == 0:
            self.pb = ProgressBar(self.term, 'pytof')
            self.pb.clear()
        self.counter += 1
        percent = self.counter / float(self.target)
        self.pb.update(percent, '(%d processed out of %d)' \
                % (self.counter, self.target))