]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
update the use of the encoder API in download.py
authorZooko O'Whielacronx <zooko@zooko.com>
Thu, 1 Feb 2007 23:30:13 +0000 (16:30 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Thu, 1 Feb 2007 23:30:13 +0000 (16:30 -0700)
src/allmydata/download.py

index ef855d159a301bb5726e1aa83e39cf603342ab08..0810c9627f6041954c6e3e64c02f86d058ebf622 100644 (file)
@@ -113,19 +113,21 @@ class FileDownloader:
         # retrieve all shares
         dl = []
         shares = []
+        shareids = []
         for (bucket_num, bucket) in all_buckets:
             d0 = bucket.callRemote("get_metadata")
             d1 = bucket.callRemote("read")
             d2 = DeferredListShouldSucceed([d0, d1])
             def _got(res):
-                sharenum_s, sharedata = res
-                sharenum = bencode.bdecode(sharenum_s)
-                shares.append((sharenum, sharedata))
+                shareid_s, sharedata = res
+                shareid = bencode.bdecode(shareid_s)
+                shares.append(sharedata)
+                shareids.append(shareid)
             d2.addCallback(_got)
             dl.append(d2)
         d = DeferredListShouldSucceed(dl)
 
-        d.addCallback(lambda res: self._decoder.decode(shares))
+        d.addCallback(lambda res: self._decoder.decode(shares, shareids))
 
         def _write(decoded_shares):
             data = "".join(decoded_shares)