Public Member Functions | Public Attributes | List of all members
progressbar.FileTransferSpeed Class Reference
Inheritance diagram for progressbar.FileTransferSpeed:
progressbar.ProgressBarWidget

Public Member Functions

def __init__ (self)
 
def update (self, pbar)
 
- Public Member Functions inherited from progressbar.ProgressBarWidget
def update (self, pbar)
 

Public Attributes

 fmt
 
 units
 

Detailed Description

Definition at line 121 of file progressbar.py.

Constructor & Destructor Documentation

def progressbar.FileTransferSpeed.__init__ (   self)

Definition at line 123 of file progressbar.py.

123  def __init__(self):
124  self.fmt = '%6.2f %s'
125  self.units = ['B','K','M','G','T','P']

Member Function Documentation

def progressbar.FileTransferSpeed.update (   self,
  pbar 
)

Definition at line 126 of file progressbar.py.

126  def update(self, pbar):
127  if pbar.seconds_elapsed < 2e-6:#== 0:
128  bps = 0.0
129  else:
130  bps = float(pbar.currval) / pbar.seconds_elapsed
131  spd = bps
132  for u in self.units:
133  if spd < 1000:
134  break
135  spd /= 1000
136  return self.fmt % (spd, u+'/s')
137 

Member Data Documentation

progressbar.FileTransferSpeed.fmt

Definition at line 124 of file progressbar.py.

progressbar.FileTransferSpeed.units

Definition at line 125 of file progressbar.py.


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