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))
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))
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
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
def clear(self): stdout.clear('left') stdout.move('left')
def clear(self): stdout.clear("left") stdout.move("left")