CMS 3D CMS Logo

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

Public Attributes

 fill
 
 fill_left
 
 left
 
 marker
 
 right
 

Static Private Attributes

tuple __slots__ = ('marker', 'left', 'right', 'fill', 'fill_left')
 

Additional Inherited Members

- Static Public Attributes inherited from progressbar.Widget
 TIME_SENSITIVE = False
 

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 
79  fill_left=True):
80  '''Creates a customizable progress bar.
81 
82  marker - string or updatable object to use as a marker
83  left - string or updatable object to use as a left border
84  right - string or updatable object to use as a right border
85  fill - character to use for the empty part of the progress bar
86  fill_left - whether to fill from the left or the right
87  '''
88  self.marker = marker
89  self.left = left
90  self.right = right
91  self.fill = fill
92  self.fill_left = fill_left
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(), ShallowClustersProducer::NearDigis.left, JME::bimap< T, U >.left, KDTreeNode.left, progressbar.Bar.left, progressbar.Bar.marker, HCAL_HLX::LUMI_RAW_HEADER.marker, ShallowClustersProducer::NearDigis.right, JME::bimap< T, U >.right, KDTreeNodes< DATA >.right, KDTreeNode.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 
95  def update(self, pbar, width):
96  'Updates the progress bar and its subcomponents'
97 
98  left, marked, right = (format_updatable(i, pbar) for i in
99  (self.left, self.marker, self.right))
100 
101  width -= len(left) + len(right)
102  # Marked must *always* have length of 1
103  if pbar.maxval:
104  marked *= int(pbar.currval / pbar.maxval * width)
105  else:
106  marked = ''
107 
108  if self.fill_left:
109  return '%s%s%s' % (left, marked.ljust(width, self.fill), right)
110  else:
return '%s%s%s' % (left, marked.rjust(width, self.fill), right)
def format_updatable
Definition: progressbar.py:411

Member Data Documentation

tuple progressbar.Bar.__slots__ = ('marker', 'left', 'right', 'fill', 'fill_left')
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

Definition at line 88 of file progressbar.py.

Referenced by svgfig.Curve.Samples.__len__(), progressbar.Bar.update(), and progressbar.BouncingBar.update().

progressbar.Bar.marker

Definition at line 87 of file progressbar.py.

Referenced by cuy.superimposeElement.__init__(), cuy.graphElement.__init__(), 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().