Increment progress by a given amount (defaults to 1) and (optionally) output the progress
    status.

def increment(self, amount=1, output=True):
    """Increment progress by a given amount (defaults to 1) and (optionally) output the progress
    status.
    """
    self._current += amount
    if output:
      # NOTE: This algorithm averages out the time it has taken to get to the current / total to
      #       determine how much time is left. So this is best used with jobs that have steps whose
      #       run time is roughly the same.

      now = datetime.now()
      elapsed_time = now - self._started_at
      expected_finish = self._started_at + elapsed_time * (1 / (self._current / self._total))
      remaining_time = expected_finish - now

      if self._format_time_remaining:
        remaining_time_str = self._format_time_remaining(remaining_time)
      else:
        remaining_time_str = str(remaining_time)

      tab_count = self._message.count("\t")
      sys.stdout.write("\r" + "\t" * tab_count + " " * (len(self._message) - tab_count))

      if isinstance(self._format, str):
        self._message = self._format.format(self._current, self._total, remaining_time_str)
      else:
        self._message = self._format(self._current, self._total, remaining_time_str)

      sys.stdout.write("\r" + self._message)
      sys.stdout.flush()