From 82f7303179d8ac1a417b032ca6e4e80e54aab8d2 Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Fri, 30 Mar 2007 18:01:37 -0700
Subject: [PATCH] log a running total of how much of your file has been
 uploaded

---
 src/allmydata/encode_new.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/allmydata/encode_new.py b/src/allmydata/encode_new.py
index dc218f18..f449176c 100644
--- a/src/allmydata/encode_new.py
+++ b/src/allmydata/encode_new.py
@@ -2,6 +2,7 @@
 
 from zope.interface import implements
 from twisted.internet import defer
+from twisted.python import log
 from allmydata.chunk import HashTree, roundup_pow2
 from allmydata.Crypto.Cipher import AES
 from allmydata.util import mathutil, hashutil
@@ -220,7 +221,9 @@ class Encoder(object):
             dl.append(d)
             subshare_hash = hashutil.tagged_hash("encoded subshare", subshare)
             self.subshare_hashes[shareid].append(subshare_hash)
-        return defer.DeferredList(dl)
+        dl = defer.DeferredList(dl)
+        dl.addCallback(lambda res: log.msg("%s uploaded %s / %s bytes of your file." % (self, self.segment_size*(segnum+1), self.segment_size*self.num_segments)))
+        return dl
 
     def send_subshare(self, shareid, segment_num, subshare):
         return self.send(shareid, "put_block", segment_num, subshare)
-- 
2.45.2