Public Member Functions | Public Attributes | Private Member Functions | List of all members
progressbar.Bar Class Reference
Inheritance diagram for progressbar.Bar:
progressbar.ProgressBarWidgetHFill progressbar.ReverseBar

Public Member Functions

def __init__ (self, marker='#', left='|', right='|')
 
def update (self, pbar, width)
 
- Public Member Functions inherited from progressbar.ProgressBarWidgetHFill
def update (self, pbar, width)
 

Public Attributes

 marker
 
 left
 
 right
 

Private Member Functions

def _format_marker (self, pbar)
 

Detailed Description

Definition at line 164 of file progressbar.py.

Constructor & Destructor Documentation

def progressbar.Bar.__init__ (   self,
  marker = '#',
  left = '|',
  right = '|' 
)

Definition at line 166 of file progressbar.py.

166  def __init__(self, marker='#', left='|', right='|'):
167  self.marker = marker
168  self.left = left
169  self.right = right
def __init__(self, marker='#', left='|', right='|')
Definition: progressbar.py:166

Member Function Documentation

def progressbar.Bar._format_marker (   self,
  pbar 
)
private

Definition at line 170 of file progressbar.py.

170  def _format_marker(self, pbar):
171  if isinstance(self.marker, str):
172  return self.marker
173  else:
174  return self.marker.update(pbar)
def _format_marker(self, pbar)
Definition: progressbar.py:170
def progressbar.Bar.update (   self,
  pbar,
  width 
)

Definition at line 175 of file progressbar.py.

175  def update(self, pbar, width):
176  percent = pbar.percentage()
177  cwidth = width - len(self.left) - len(self.right)
178  marked_width = int(percent * cwidth // 100)
179  m = self._format_marker(pbar)
180  bar = (self.left + (m*marked_width).ljust(cwidth) + self.right)
181  return bar
182 
def update(self, pbar, width)
Definition: progressbar.py:175
def _format_marker(self, pbar)
Definition: progressbar.py:170

Member Data Documentation

progressbar.Bar.left

Definition at line 168 of file progressbar.py.

progressbar.Bar.marker

Definition at line 167 of file progressbar.py.

progressbar.Bar.right

Definition at line 169 of file progressbar.py.


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