docs: def console_progress():
      """ Return a progress indicator for consoles if
          stdout is a tty.
      """
      def progress(totalhashed, totalsize):
          "Helper"
          msg = " " * 30
          if totalhashed < totalsize:
              msg = "%5.1f%% complete" % (totalhashed * 100.0 / totalsize)
          sys.stdout.write(msg + " \r")
          sys.stdout.flush()
  
      try:
          return progress if sys.stdout.isatty() else None
      except AttributeError:
          return None