CBLUE = CESC + "34m"
CCYAN = CESC + "36m"
CDEFAULT = CESC + "0m"
- CRESET = CDEFAULT + CCURSOR
+ CWRAP = CESC + "?7h"
+ CNOWRAP = CESC + "?7l"
+ CRESET = CDEFAULT + CCURSOR + CWRAP
CUP = CESC + "1A"
CREVERSENL= "\r" + CUP
for i in range(r, barwidth):
p += ' '
+ stdout.write(self.CNOWRAP)
self.color1("\r" + msg)
self.color1(" [%s] %d%%" % (p, ratio * 100))
if end:
if stats:
stdout.write(self.CREVERSENL)
+ stdout.write(self.CWRAP)
sys.stdout.flush()
self.need_newline = True
- def _print_progress(self, ratio, end = False):
- self.color3("\r[%d%%]" % (ratio * 100))
- #if end:
- # self.color2(" (%.2fs)" % (time.time() - self.start_time))
-
- #self.color("\n%s" % self.task.__doc__)
- #self.color3(" warnings: %d" % len(self.warnings))
- stats = self.task.get_stats()
- if len(self.warnings):
- stats['warnings'] = len(self.warnings)
- if stats:
- stdout.write(" %s" % self.fmt_stats(stats))
-
- if end:
- stdout.write("\n")
- sys.stdout.flush()
- self.need_newline = True
-
-
def start(self, task, count = 1):
self.start_time = time.time()
self.task = task
def interrupt(self):
self.color3("Interrupted\n")
stdout.write(self.CRESET)
-
def terminate(self):
self.color3(self.sep + "\n")