def update(self, pbar):
if pbar.currval == <NUM_LIT:0>:<EOL><INDENT>return self.eta_format % '<STR_LIT>'<EOL><DEDENT>elif pbar.finished:<EOL><INDENT>return self.complete_format % self.format_time(pbar.seconds_elapsed)<EOL><DEDENT>else:<EOL><INDENT>elapsed = pbar.seconds_elapsed<EOL>eta = elapsed * pbar.maxval / pbar.currval - elapsed<EOL>return self.eta_format % self.format_time(eta)<EOL><DEDENT>
Updates the widget to show the ETA or total time when finished.