diff --git a/python/obitools3/apps/progress.pyx b/python/obitools3/apps/progress.pyx index cd3baa1..87233f5 100755 --- a/python/obitools3/apps/progress.pyx +++ b/python/obitools3/apps/progress.pyx @@ -68,7 +68,7 @@ cdef class ProgressBar: '##########' - def __call__(self, object pos): + def __call__(self, object pos, bint force=False): cdef off_t ipos cdef clock_t elapsed cdef clock_t newtime @@ -82,7 +82,7 @@ cdef class ProgressBar: self.cycle+=1 - if self.cycle % self.freq == 0: + if self.cycle % self.freq == 0 or force: self.cycle=1 newtime = self.clock() delta = newtime - self.lasttime @@ -117,7 +117,7 @@ cdef class ProgressBar: self.arrow=(self.arrow+1) % 4 if days: - fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %d days %02d:%02d:%02d\t', + fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %d days %02d:%02d:%02d\033[K', self.chead, percent*100, fraction,self.diese, @@ -125,7 +125,7 @@ cdef class ProgressBar: 50-fraction,self.spaces, days,hour,minu,sec) else: - fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %02d:%02d:%02d\t', + fprintf(stderr,b'\r%s %5.1f %% |%.*s%c%.*s] remain : %02d:%02d:%02d\033[K', self.chead, percent*100., fraction,self.diese, @@ -140,7 +140,7 @@ cdef class ProgressBar: if self.ontty: fputs(b'\n',stderr) - self.logger.info('%s %5.1f %% remain : %02d:%02d:%02d' % ( + self.logger.info('%s %5.1f %% remain : %02d:%02d:%02d\033[K' % ( bytes2str(self._head), percent*100., hour,minu,sec))