urlgrabber.progress
index
/home/groups/urlgrabber/web/contents/urlgrabber/progress.py

#   This library is free software; you can redistribute it and/or
#   modify it under the terms of the GNU Lesser General Public
#   License as published by the Free Software Foundation; either
#   version 2.1 of the License, or (at your option) any later version.
#
#   This library is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#   Lesser General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public
#   License along with this library; if not, write to the 
#      Free Software Foundation, Inc., 
#      59 Temple Place, Suite 330, 
#      Boston, MA  02111-1307  USA

 
Modules
       
math
sys
thread
time

 
Classes
       
BaseMeter
MultiFileHelper
TextMeter
TextMeter
MultiFileMeter
TextMultiFileMeter
RateEstimator

 
class BaseMeter
     Methods defined here:
__init__(self)
end(self, amount_read, now=None)
start(self, filename=None, url=None, basename=None, size=None, now=None, text=None)
update(self, amount_read, now=None)

 
class MultiFileHelper(BaseMeter)
     Methods defined here:
__init__(self, master)
failure(self, message, now=None)
message(self, message)

Methods inherited from BaseMeter:
end(self, amount_read, now=None)
start(self, filename=None, url=None, basename=None, size=None, now=None, text=None)
update(self, amount_read, now=None)

 
class MultiFileMeter
     Methods defined here:
__init__(self)
end(self, now=None)
end_meter(self, meter, now)
failure_meter(self, meter, message, now)
lock(self)
message_meter(self, meter, message)
newMeter(self)
###########################################################
# child meter creation and destruction
removeMeter(self, meter)
start(self, numfiles=None, total_size=None, now=None)
start_meter(self, meter, now)
###########################################################
# child functions - these should only be called by helpers
unlock(self)
update_meter(self, meter, now)

Data and other attributes defined here:
helperclass = <class urlgrabber.progress.MultiFileHelper>

 
class RateEstimator
     Methods defined here:
__init__(self, timescale=5.0)
average_rate(self)
get the average transfer rate (in bytes/second)
elapsed_time(self)
the time between the start of the transfer and the most recent update
fraction_read(self)
the fraction of the data that has been read
(can be None for unknown transfer size)
remaining_time(self)
estimated time remaining
start(self, total=None, now=None)
update(self, amount_read, now=None)

 
class TextMeter(BaseMeter)
     Methods defined here:
__init__(self, fo=<open file '<stderr>', mode 'w'>)

Methods inherited from BaseMeter:
end(self, amount_read, now=None)
start(self, filename=None, url=None, basename=None, size=None, now=None, text=None)
update(self, amount_read, now=None)

 
class TextMultiFileMeter(MultiFileMeter)
     Methods defined here:
__init__(self, fo=<open file '<stderr>', mode 'w'>)
message_meter(self, meter, message)

Methods inherited from MultiFileMeter:
end(self, now=None)
end_meter(self, meter, now)
failure_meter(self, meter, message, now)
lock(self)
newMeter(self)
###########################################################
# child meter creation and destruction
removeMeter(self, meter)
start(self, numfiles=None, total_size=None, now=None)
start_meter(self, meter, now)
###########################################################
# child functions - these should only be called by helpers
unlock(self)
update_meter(self, meter, now)

Data and other attributes inherited from MultiFileMeter:
helperclass = <class urlgrabber.progress.MultiFileHelper>

 
text_progress_meter = class TextMeter(BaseMeter)
     Methods defined here:
__init__(self, fo=<open file '<stderr>', mode 'w'>)

Methods inherited from BaseMeter:
end(self, amount_read, now=None)
start(self, filename=None, url=None, basename=None, size=None, now=None, text=None)
update(self, amount_read, now=None)

 
Functions
       
format_number(number, SI=0, space=' ')
Turn numbers into human-readable metric-like numbers
format_time(seconds, use_hours=0)