]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
encode.py: log a percentage complete as well as the raw byte counts
authorBrian Warner <warner@allmydata.com>
Fri, 10 Aug 2007 01:28:45 +0000 (18:28 -0700)
committerBrian Warner <warner@allmydata.com>
Fri, 10 Aug 2007 01:28:45 +0000 (18:28 -0700)
src/allmydata/encode.py

index 04f566118cde525036cee6ce462a2a585eb4d584..48878a963613afe2124bd59465694d1ae0805507 100644 (file)
@@ -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