CMS 3D CMS Logo

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

Public Member Functions

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)
 

Public Attributes

 fill
 
 fill_left
 
 left
 
 marker
 
 right
 

Static Private Attributes

 __slots__
 

Additional Inherited Members

- Static Public Attributes inherited from progressbar.Widget
 TIME_SENSITIVE
 

Detailed Description

Definition at line 72 of file progressbar.py.

Constructor & Destructor Documentation

def progressbar.Bar.__init__ (   self,
  marker = '#',
  left = '|',
  right = '|',
  fill = ' ',
  fill_left = True 
)
Creates a customizable progress bar.

marker - string or updatable object to use as a marker
left - string or updatable object to use as a left border
right - string or updatable object to use as a right border
fill - character to use for the empty part of the progress bar
fill_left - whether to fill from the left or the right

Definition at line 78 of file progressbar.py.

78  fill_left=True):
79  '''Creates a customizable progress bar.
80 
81  marker - string or updatable object to use as a marker
82  left - string or updatable object to use as a left border
83  right - string or updatable object to use as a right border
84  fill - character to use for the empty part of the progress bar
85  fill_left - whether to fill from the left or the right
86  '''
87  self.marker = marker
88  self.left = left
89  self.right = right
90  self.fill = fill
91  self.fill_left = fill_left
92 
93 

Member Function Documentation

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

Definition at line 94 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, KDTreeNodeT< DATA, DIM >.left, KDTreeNode.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 >.right, KDTreeNodeT< DATA, DIM >.right, KDTreeNode.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__(), Vispa.Gui.VispaWidget.VispaWidget.autosize(), Vispa.Views.LineDecayView.LineDecayContainer.createObject(), Vispa.Views.LineDecayView.LineDecayContainer.deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget.enableAutosizing(), progressbar.ProgressBar.finish(), Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget.mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer.mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer.objectMoved(), MatrixUtil.Steps.overwrite(), Vispa.Views.LineDecayView.LineDecayContainer.removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget.removePorts(), Vispa.Gui.FindDialog.FindDialog.reset(), Vispa.Gui.PortConnection.PointToPointConnection.select(), Vispa.Gui.VispaWidget.VispaWidget.select(), Vispa.Views.LineDecayView.LineDecayContainer.select(), Vispa.Gui.VispaWidget.VispaWidget.setText(), Vispa.Gui.VispaWidget.VispaWidget.setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Views.LineDecayView.LineDecayContainer.setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

94  def update(self, pbar, width):
95  'Updates the progress bar and its subcomponents'
96 
97  left, marked, right = (format_updatable(i, pbar) for i in
98  (self.left, self.marker, self.right))
99 
100  width -= len(left) + len(right)
101  # Marked must *always* have length of 1
102  if pbar.maxval:
103  marked *= int(pbar.currval / pbar.maxval * width)
104  else:
105  marked = ''
106 
107  if self.fill_left:
108  return '%s%s%s' % (left, marked.ljust(width, self.fill), right)
109  else:
110  return '%s%s%s' % (left, marked.rjust(width, self.fill), right)
def format_updatable(updatable, pbar)
Definition: progressbar.py:411
def update(self, pbar, width)
Definition: progressbar.py:94

Member Data Documentation

progressbar.Bar.__slots__
staticprivate

Definition at line 75 of file progressbar.py.

progressbar.Bar.fill

Definition at line 90 of file progressbar.py.

Referenced by progressbar.Bar.update(), and progressbar.BouncingBar.update().

progressbar.Bar.fill_left

Definition at line 91 of file progressbar.py.

Referenced by progressbar.Bar.update(), and progressbar.BouncingBar.update().

progressbar.Bar.left
progressbar.Bar.marker

Definition at line 87 of file progressbar.py.

Referenced by progressbar.Bar.update(), and progressbar.BouncingBar.update().

progressbar.Bar.right

Definition at line 89 of file progressbar.py.

Referenced by progressbar.Bar.update(), and progressbar.BouncingBar.update().