From: Brian Warner Date: Fri, 10 Aug 2007 01:28:45 +0000 (-0700) Subject: encode.py: log a percentage complete as well as the raw byte counts X-Git-Tag: allmydata-tahoe-0.5.0~84 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/?a=commitdiff_plain;h=8b14ad16733f99234a1fa9b060c2d5adc4e74e32;p=tahoe-lafs%2Ftahoe-lafs.git encode.py: log a percentage complete as well as the raw byte counts --- diff --git a/src/allmydata/encode.py b/src/allmydata/encode.py index 04f56611..48878a96 100644 --- a/src/allmydata/encode.py +++ b/src/allmydata/encode.py @@ -384,9 +384,15 @@ class Encoder(object): # (shareid, segnum, len(subshare), # subshare[:50], subshare[-50:], idlib.b2a(subshare_hash))) self.subshare_hashes[shareid].append(subshare_hash) + dl = self._gather_responses(dl) def _logit(res): - log.msg("%s uploaded %s / %s bytes of your file." % (self, self.segment_size*(segnum+1), self.segment_size*self.num_segments)) + log.msg("%s uploaded %s / %s bytes (%d%%) of your file." % + (self, + self.segment_size*(segnum+1), + self.segment_size*self.num_segments, + 100 * (segnum+1) / self.num_segments, + )) return res dl.addCallback(_logit) return dl