CMS 3D CMS Logo

List of all members | Public Member Functions
progressbar.BouncingBar Class Reference
Inheritance diagram for progressbar.BouncingBar:
progressbar.Bar progressbar.WidgetHFill progressbar.Widget

Public Member Functions

def update (self, pbar, width)
 
- Public Member Functions inherited from progressbar.Bar
def __init__ (self, marker='#', left='|', right='|', fill=' ', fill_left=True)
 
def update (self, pbar, width)
 
- Public Member Functions inherited from progressbar.WidgetHFill
def update (self, pbar, width)
 
- Public Member Functions inherited from progressbar.Widget
def update (self, pbar)
 

Additional Inherited Members

- Public Attributes inherited from progressbar.Bar
 fill
 
 fill_left
 
 left
 
 marker
 
 right
 
- Static Public Attributes inherited from progressbar.Widget
 TIME_SENSITIVE
 

Detailed Description

Definition at line 111 of file progressbar.py.

Member Function Documentation

◆ update()

def progressbar.BouncingBar.update (   self,
  pbar,
  width 
)

Definition at line 112 of file progressbar.py.

References progressbar.Bar.fill, progressbar.Bar.fill_left, progressbar.format_updatable(), createfilelist.int, ShallowClustersProducer::NearDigis.left, JME::bimap< T, U >.left, BinaryOP.left, progressbar.Bar.left, progressbar.Bar.marker, HCAL_HLX::LUMI_RAW_HEADER.marker, ShallowClustersProducer::NearDigis.right, JME::bimap< T, U >.right, KDTreeNodes< DATA, DIM >.right, BinaryOP.right, progressbar.Bar.right, svgfig.Curve.Sample.right, and svgfig.Curve.Samples.right.

Referenced by progressbar.ProgressBar.__next__(), MatrixUtil.Matrix.__setitem__(), MatrixUtil.Steps.__setitem__(), progressbar.ProgressBar.finish(), and MatrixUtil.Steps.overwrite().

112  def update(self, pbar, width):
113  'Updates the progress bar and its subcomponents'
114 
115  left, marker, right = (format_updatable(i, pbar) for i in
116  (self.left, self.marker, self.right))
117 
118  width -= len(left) + len(right)
119 
120  if pbar.finished: return '%s%s%s' % (left, width * marker, right)
121 
122  position = int(pbar.currval % (width * 2 - 1))
123  if position > width: position = width * 2 - position
124  lpad = self.fill * (position - 1)
125  rpad = self.fill * (width - len(marker) - len(lpad))
126 
127  # Swap if we want to bounce the other way
128  if not self.fill_left: rpad, lpad = lpad, rpad
129 
130  return '%s%s%s%s%s' % (left, lpad, marker, rpad, right)
131 
def format_updatable(updatable, pbar)
Definition: progressbar.py:411
#define update(a, b)