示例#1
0
 def _need_update(self):
     import time
     # Force this to be updated independant of the need_update decision
     # (this is normally computed in update(), but is skipped if we don't need to display anything)
     if not self.start_time: self.start_time = time.time()
     self.seconds_elapsed = time.time() - self.start_time
     if self.seconds_elapsed < _NOSHOWTIME: return False
     if not ProgressBar._need_update(self): return False
     if not self.printed_message:
         if self.message is not None: print(self.message)
         self.printed_message = True
     return True
示例#2
0
 def _need_update(self):
   import time
   # Force this to be updated independant of the need_update decision
   # (this is normally computed in update(), but is skipped if we don't need to display anything)
   if not self.start_time: self.start_time = time.time()
   self.seconds_elapsed = time.time() - self.start_time
   if self.seconds_elapsed < _NOSHOWTIME: return False
   if not ProgressBar._need_update(self): return False
   if not self.printed_message:
     if self.message is not None: print(self.message)
     self.printed_message = True
   return True