class_docstr: Class for generating a command-line progressbar
  
  Parameters
  ----------
  max_value : int
      Maximum value of process (e.g. number of samples to process, bytes to
      download, etc.).
  initial_value : int
      Initial value of process, useful when resuming process from a specific
      value, defaults to 0.
  mesg : str
      Message to include at end of progress bar.
  max_chars : int
      Number of characters to use for progress bar (be sure to save some room
      for the message and % complete as well).
  progress_character : char
      Character in the progress bar that indicates the portion completed.
  spinner : bool
      Show a spinner.  Useful for long-running processes that may not
      increment the progress bar very often.  This provides the user with
      feedback that the progress has not stalled.
class_docstr_tok: ["Class","for","generating","a","command-line","progressbar","Parameters","--","--","--","--","--","max_value",":","int","Maximum","value","of","process","(","e.g",".","number","of","samples","to","process",",","bytes","to","download",",","etc.",")",".","initial_value",":","int","Initial","value","of","process",",","useful","when","resuming","process","from","a","specific","value",",","defaults","to","0.","mesg",":","str","Message","to","include","at","end","of","progress","bar",".","max_chars",":","int","Number","of","characters","to","use","for","progress","bar","(","be","sure","to","save","some","room","for","the","message","and","%","complete","as","well",")",".","progress_character",":","char","Character","in","the","progress","bar","that","indicates","the","portion","completed",".","spinner",":","bool","Show","a","spinner",".","Useful","for","long-running","processes","that","may","not","increment","the","progress","bar","very","often",".","This","provides","the","user","with","feedback","that","the","progress","has","not","stalled","."]
docstr: Update progressbar with current value of process
  
  Parameters
  ----------
  cur_value : number
      Current value of process.  Should be <= max_value (but this is not
      enforced).  The percent of the progressbar will be computed as
      (cur_value / max_value) * 100
  mesg : str
      Message to display to the right of the progressbar.  If None, the
      last message provided will be used.  To clear the current message,
      pass a null string, ''.
docstr_tok: ["Update","progressbar","with","current","value","of","process","Parameters","--","--","--","--","--","cur_value",":","number","Current","value","of","process",".","Should","be","<","=","max_value","(","but","this","is","not","enforced",")",".","The","percent","of","the","progressbar","will","be","computed","as","(","cur_value","\/","max_value",")","*","100","mesg",":","str","Message","to","display","to","the","right","of","the","progressbar",".","If","None",",","the","last","message","provided","will","be","used",".","To","clear","the","current","message",",","pass","a","null","string",",","``","."]
code: def update(self, cur_value, mesg=None):
      """Update progressbar with current value of process
  
      Parameters
      ----------
      cur_value : number
          Current value of process.  Should be <= max_value (but this is not
          enforced).  The percent of the progressbar will be computed as
          (cur_value / max_value) * 100
      mesg : str
          Message to display to the right of the progressbar.  If None, the
          last message provided will be used.  To clear the current message,
          pass a null string, ''.
      """
      # Ensure floating-point division so we can get fractions of a percent
      # for the progressbar.
      self.cur_value = cur_value
      progress = float(self.cur_value) / self.max_value
      num_chars = int(progress * self.max_chars)
      num_left = self.max_chars - num_chars
  
      # Update the message
      if mesg is not None:
          self.mesg = mesg
  
      # The \r tells the cursor to return to the beginning of the line rather
      # than starting a new line.  This allows us to have a progressbar-style
      # display in the console window.
      bar = self.template.format(
          self.progress_character * num_chars,
          " " * num_left,
          progress * 100,
          self.spinner_symbols[self.spinner_index],
          self.mesg,
      )
      sys.stdout.write(bar)
      # Increament the spinner
      if self.spinner:
          self.spinner_index = (self.spinner_index + 1) % self.n_spinner
  
      # Force a flush because sometimes when using bash scripts and pipes,
      # the output is not printed until after the program exits.
      sys.stdout.flush()
  
file_path: vispy/vispy/util/fetching.py
imports: from math import log
  import os
  from os import path
  import sys
  import shutil
  import time
  import urllib.request
  from ..util.config import config
label_desc: Use image node_id 2 for calling the ProgressBar obj's underlying member method code with example usage: obj.update(cur_value, mesg) without return types