Ejemplo n.º 1
0
 def update(self, percent, message = None, test = False):
     """
     """
     if self.refresh:
         self.clear()
     if self.drawn:
         stdout.move('beginning of line')
         stdout.move('up', len(self.message) + self.barlines)
     else:
         title = self.get_title()
         if title != None:
             for line in self.get_title():
                 stdout.write(line + os.linesep)
         self.drawn = True
     bar = self.get_bar(percent)
     refresh =  (len(bar) != self.barlines)
     self.barlines = len(bar)
     for line in bar:
         stdout.clear('line')
         stdout.write(line)
         stdout.move('down')
         stdout.move('beginning of line')
     if (message != self.get_message()) or refresh:
         stdout.clear('end of screen')
         self.set_message(message)
         for line in self.message:
             stdout.write(line)
             stdout.move('down')
     else: stdout.move('down', len(self.message))
Ejemplo n.º 2
0
 def update(self, percent, message=None, test=False):
     """
     """
     if self.refresh:
         self.clear()
     if self.drawn:
         stdout.move('beginning of line')
         stdout.move('up', len(self.message) + self.barlines)
     else:
         title = self.get_title()
         if title != None:
             for line in self.get_title():
                 stdout.write(line + os.linesep)
         self.drawn = True
     bar = self.get_bar(percent)
     refresh = (len(bar) != self.barlines)
     self.barlines = len(bar)
     for line in bar:
         stdout.clear('line')
         stdout.write(line)
         stdout.move('down')
         stdout.move('beginning of line')
     if (message != self.get_message()) or refresh:
         stdout.clear('end of screen')
         self.set_message(message)
         for line in self.message:
             stdout.write(line)
             stdout.move('down')
     else:
         stdout.move('down', len(self.message))
Ejemplo n.º 3
0
 def clear(self):
     """
     """
     if self.drawn:
         stdout.move('beginning of line')
         stdout.move('up', len(self.message))
         stdout.move('up', self.barlines)
         stdout.move('up', len(self.get_title()))
         stdout.clear('end of screen')
         self.drawn = False
     self.refresh = False
Ejemplo n.º 4
0
 def clear(self):
     """
     """
     if self.drawn:
         stdout.move("beginning of line")
         stdout.move("up", len(self.message))
         stdout.move("up", self.barlines)
         stdout.move("up", len(self.get_title()))
         stdout.clear("end of screen")
         self.drawn = False
     self.refresh = False
Ejemplo n.º 5
0
 def clear(self):
     """
     """
     if self.drawn:
         stdout.move('beginning of line')
         stdout.move('up', len(self.message))
         stdout.move('up', self.barlines)
         stdout.move('up', len(self.get_title()))
         stdout.clear('end of screen')
         self.drawn = False
     self.refresh = False
Ejemplo n.º 6
0
 def clear(self):
     stdout.clear('left')
     stdout.move('left')
Ejemplo n.º 7
0
 def clear(self):
     stdout.clear("left")
     stdout.move("left")
Ejemplo n.º 8
0
 def clear(self):
     stdout.clear('left')
     stdout.move('left')