CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
- Public Member Functions inherited from progressbar.Bar
def __init__
 
def update
 
- Public Member Functions inherited from progressbar.WidgetHFill
def update
 
- Public Member Functions inherited from progressbar.Widget
def update
 

Additional Inherited Members

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

Detailed Description

Definition at line 111 of file progressbar.py.

Member Function Documentation

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(), 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().

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