Cat
Public Member Functions | Public Attributes | List of all members
progressbar.AnimatedProgressBar Class Reference
Inheritance diagram for progressbar.AnimatedProgressBar:
progressbar.ProgressBar

Public Member Functions

def __init__ (self, args, kwargs)
 
def show_progress (self)
 
- Public Member Functions inherited from progressbar.ProgressBar
def __init__ (self, process=" ", start=0, end=10, width=12, fill='=', blank='.', format='running %(process) s [%(fill) s%(blank) s] %(progress) s%%', incremental=True)
 
def __add__ (self, increment)
 
def __str__ (self)
 
def set (self, value)
 
def reset (self)
 

Public Attributes

 stdout
 
 last_indicator
 
- Public Attributes inherited from progressbar.ProgressBar
 start
 
 end
 
 width
 
 fill
 
 blank
 
 format
 
 incremental
 
 step
 
 process
 
 progress
 

Detailed Description

Extends ProgressBar to allow you to use it straighforward on a script.
Accepts an extra keyword argument named `stdout` (by default use sys.stdout)
and may be any file-object to which send the progress status.

Definition at line 64 of file progressbar.py.

Constructor & Destructor Documentation

◆ __init__()

def progressbar.AnimatedProgressBar.__init__ (   self,
  args,
  kwargs 
)

Definition at line 69 of file progressbar.py.

69  def __init__(self, *args, **kwargs):
70  super(AnimatedProgressBar, self).__init__(*args, **kwargs)
71  self.stdout = kwargs.get('stdout', sys.stdout)
72  self.last_indicator = ''
73 
def __init__(self, dict)
Definition: wrapper.py:56

Member Function Documentation

◆ show_progress()

def progressbar.AnimatedProgressBar.show_progress (   self)

Definition at line 74 of file progressbar.py.

References progressbar.AnimatedProgressBar.last_indicator, and progressbar.AnimatedProgressBar.stdout.

74  def show_progress(self):
75  indicator = str(self)
76  if indicator == self.last_indicator:
77  return
78  if hasattr(self.stdout, 'isatty') and self.stdout.isatty():
79  self.stdout.write('\r')
80  else:
81  self.stdout.write('\n')
82  self.stdout.write(str(self))
83  self.stdout.flush()
84  self.last_indicator = indicator
85 

Member Data Documentation

◆ last_indicator

progressbar.AnimatedProgressBar.last_indicator

Definition at line 72 of file progressbar.py.

Referenced by progressbar.AnimatedProgressBar.show_progress().

◆ stdout

progressbar.AnimatedProgressBar.stdout

Definition at line 71 of file progressbar.py.

Referenced by progressbar.AnimatedProgressBar.show_progress().


The documentation for this class was generated from the following file: